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.

CORE API / CATATAN</>
Core API23 Jul 2007

How do I use Console class to read user input?

In the previous example, How do I read user input from console using Scanner class?, we use the java.util.Scanner class to read user input. In this example we use another new class introduced in the Java 1.6, the java.io.Console class. The Console class provide methods like readLine() and readPassword(). The readPassword() method can be used […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API22 Jul 2007

How do I read user input from console using java.util.Scanner class?

In JDK 1.5 a java.util.Scanner class was introduced to handle user input in console application. This class enable us to read string, integer, long, etc. package org.kodejava.util; import java.util.Scanner; public class ScannerDemo { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // Read string input for username System.out.print("Username: "); String username = […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API19 Jul 2007

How do I use ResourceBundle for i18n?

Creating an application for users in different regions can be hard in terms of the message format for the local region. Java provide a ResourceBundle class that help internationalize our application. To create resources for i18n (there are 18 letters between the first i and the final n) we need to create a file for […]

Wayan · 2 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons14 Jul 2007

How do I convert an array of object to an array of primitive?

In the code example below we demonstrate the ArrayUtils.toPrimitive() method to convert an array of Integer object to an array of its primitive type. Besides converting an array of Integer objects, this method is overloaded to accept other types of object’s array. package org.kodejava.commons.lang; import org.apache.commons.lang3.ArrayUtils; public class ArrayObjectToPrimitiveDemo { public static void main(String[] args) […]

Wayan · 1 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons11 Jul 2007

How do I convert an array to a Map?

This example uses the Apache Commons Lang’s ArrayUtils.toMap() method to convert a two-dimensional array into a Map object. To convert a two-dimensional array into a Map object, each element of the two-dimensional array must be an array with at least two elements where the first element will be the key and the second element will […]

Wayan · 2 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons09 Jul 2007

How do I reverse array elements order?

In this example we are going to use the ArraysUtils helper class from the Apache Commons Lang library to reverse the order of array elements. The method to reverse the order of array elements is ArrayUtils.reverse() method. The ArrayUtils.reverse() method is overloaded, so we can reverse another type of array such as java.lang.Object, long, int, […]

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.