GENERAL / CATATAN</>↗General09 Mei 2020
When it comes to using programming languages, coders can make an easy choice. Python is the fastest growing language, but JavaScript is still the most popular one. A great programmer knows what language to focus on, depending on the projects they develop. But what about other programming tools? The language is not the only thing […]
JAVA 8 / CATATAN</>↗Java 825 Apr 2020
The following code snippet will show you how to convert the old java.util.TimeZone to java.time.ZoneId introduced in Java 8. In the first line of our main() method we get the default timezone using the TimeZone.getDefault() and convert it to ZoneId by calling the toZoneId() method. In the second example we create the TimeZone object by […]
JAVA 8 / CATATAN</>↗Java 825 Apr 2020
To retrieve a list of all available time zones ids we can call the java.time.ZoneId static method getAvailableZoneIds(). This method return a Set of string of all zone ids. The format of the zone id are “{area}/{city}”. You can use these ids of string to create the ZoneId object using the ZoneId.of() static method. package […]
HTTPCLIENT / CATATAN</>↗HttpClient22 Apr 2020
The HTTP HEAD method is used for reading the headers information of a resource returned when accessing it using the HTTP GET method. Such request can be done before deciding to download a large resource to save bandwidth. The response to a HEAD method should not have a body, in the code below we use […]
HTTPCLIENT / CATATAN</>↗HttpClient21 Apr 2020
The HTTP Client API can be used to request HTTP resources over the network. This new API was introduced as a new API in Java 11. It supports HTTP/1.1 and HTTP/2 and also support both synchronous and asynchronous programming models. The code snippet below show you how to use the new API to read the […]
JAVA DATE TIME API / CATATAN</>↗Java Date Time API20 Apr 2020
The easiest way to modify the value of a LocalDate, LocalTime or LocalDateTime object is to use the with() method of the corresponding object. These methods will return a modified version of the object, it doesn’t change the attribute of the original object. All the methods, like withYear(), withDayOfMonth() or the with(ChronoField) of the LocalDate […]