TOOLS / CATATAN</>↗Tools19 Jul 2015
The easiest way to install Oracle Java (JDK) in Ubuntu is to use the WebUpd8 PPA. A PPA (Personal Package Archive) is a special software repository for uploading source packages to be build and published as an APT repository by Launchpad. This PPA will download the required files from Oracle and install JDK7 / JDK8 […]
JAVA 8 / CATATAN</>↗Java 818 Jul 2015
The following example show you how to get the length of a month represented by a java.time.LocalDate and a java.time.YearMonth objects. Both of these classes have a method called lengthOfMonth() that returns the length of month in days represented by those date objects. package org.kodejava.datetime; import java.time.LocalDate; import java.time.Month; import java.time.YearMonth; public class LengthOfMonth { […]
JAVA 8 / CATATAN</>↗Java 816 Jul 2015
The example How do I check if a year is a leap year? use the java.util.Calendar object to determine if a given year is a leap year. That was the way to do it using the old API before we have the Date and Time API introduced in Java 8. Now, in the Java 8 […]
JAVA 8 / CATATAN</>↗Java 812 Sep 2014
In this code snippet you will learn how to parse a string into an instance of LocalDate, LocalTime and LocalDateTime. All of these classes provide a parse() method that accept an argument of string that represent a valid date and time information and convert it into the corresponding object. If the string passed into the […]
JAVA 8 / CATATAN</>↗Java 811 Sep 2014
The java.time.LocalDateTime class represents information of both date and time without time-zone. We can create LocalDateTime using the available static factory method such as the of() method or by combining an instance of LocalDate and LocalTime. The following code snippet will show you both ways. First we begin with using the of() method where we […]
JAVA 8 / CATATAN</>↗Java 807 Sep 2014
An instance of LocalTime class represent information about time. It doesn’t contain information about date. To create an instance of this class we can use the of() static factory method. There are two types of this method. The first one accept two arguments, hour and minute. The second type also accept the second as the […]