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 API19 Mei 2007

How do I use the HashMap class?

This example demonstrate you how to use the HashMap class to store values in a key-value structure. In this example we store a map of error codes with their corresponding description. To store a value into the map we use the put(key, value) method and to get it back we use the get(key) method. And […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API16 Mei 2007

How do I generate a random array of numbers?

Using java.util.Random class we can create random data such as boolean, integer, floats, double. First you’ll need to create an instance of the Random class. This class has some next***() methods that can randomly create the data. package org.kodejava.util; import java.util.Arrays; import java.util.Random; public class RandomDemo { public static void main(String[] args) { Random r […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API11 Mei 2007

How do I reverse a string by word?

In the other examples on this website you might have seen how to reverse a string using StringBuffer, StringUtils from Apache Commons Lang library or using the CharacterIterator. In this example you’ll see another way that you can use to reverse a string by word. Here we use the StringTokenizer and the Stack class. package […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API07 Mei 2007

How do I convert varargs to an array?

Varargs can be seen as a simplification of array when we need to pass a multiple value as a method parameter. Varargs itself is an array that automatically created, for these reason you will be enabled to do things you can do with array to varargs. In the example below you can see the messages […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API02 Mei 2007

How do I remove trailing white space from a string?

The trim() method of a String class removes both leading and trailing white space from a string. In this example we use a regular expression to remove only the trailing white spaces from a string. package org.kodejava.lang; public class TrailingSpace { public static void main(String[] args) { String text = " tattarrattat "; System.out.println("Original = […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API27 Apr 2007

How do I remove leading white space from a string?

The trim() method of a String class removes both leading and trailing white space from a string. In this example we use a regular expression to remove only the leading white spaces from a string. package org.kodejava.lang; public class LeadingSpace { public static void main(String[] args) { String text = " tattarrattat "; System.out.println("Original = […]

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.