Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

GOOGLE GSON / CATATAN</>
Google Gson04 Feb 2010

How do I convert array into JSON?

In the example below you can see how to convert an array into JSON string. We serialize the array to JSON using the Gson.toJson() method. To deserialize a string of JSON into array we use the Gson.fromJson() method. package org.kodejava.gson; import com.google.gson.Gson; public class ArrayToJson { public static void main(String[] args) { int[] numbers = […]

Wayan · 2 menit baca
GOOGLE GSON / CATATAN</>
Google Gson03 Feb 2010

How does Gson handles object fields?

In this example you’ll see how the Gson library handles the object fields. For object fields to be serialized into JSON string it doesn’t need to use any annotations, it can even read private fields. If you have a null value field it will not be serialized into JSON string. To exclude a field from […]

Wayan · 2 menit baca
GOOGLE GSON / CATATAN</>
Google Gson01 Feb 2010

How do I convert JSON into object?

On the previous example, How do I convert object into JSON? we convert object into JSON string. In this example you will see how to do the opposite, converting JSON string back into object. To convert JSON string to object use Gson.fromJson() method. This method takes the JSON string and the object type of the […]

Wayan · 2 menit baca
GOOGLE GSON / CATATAN</>
Google Gson30 Jan 2010

How do I convert object into JSON?

In this example we are using Google Gson to convert an object (Student object) into JSON notation. Practically we can use this library to convert any object in Java, and it is quite simple. You just need to create an instance of Gson class and then call the toJson() method and pass the object to […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API27 Jan 2010

How do I create a console progress bar?

The code below demonstrates how to create a progress bar in a console program. The trick is to print the progress status using a System.out.print() and add a carriage return character ("\r") at the end of the string to return the cursor position to the beginning of the line and print the next progress status. […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API23 Jan 2010

How do I calculate process execution time in higher resolution?

This example demonstrates how to use the System.nanoTime() method to calculate processing execution time in higher resolution. The processing time calculated in nanoseconds resolution. package org.kodejava.lang; public class NanoSecondsTimerResolution { public static void main(String[] args) { // Get process execution start time in nanoseconds. long start = System.nanoTime(); System.out.println("Process start… " + start); try { […]

Wayan · 1 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.