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
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

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
APACHE COMMONS / CATATAN</>
Apache Commons28 Agt 2006

How do I create a copy of a file?

This example shows how we can use the Apache Commons IO library to simplify a file copy process. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; import java.io.IOException; public class FileCopyExample { public static void main(String[] args) { // The source file name to be copied. File source = new File("README.md"); // The target file name to […]

Wayan · 2 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons13 Agt 2006

How do I count word occurrences in a string?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class WordCountDemo { public static void main(String[] args) { // We have the source text we'll do the search on. String source = "From the download page, you can download the Java " + "Tutorials for browsing offline. Or you can just download " + "the example."; // The word […]

Wayan · 1 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons09 Agt 2006

How do I reverse a string, words or sentences?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class StringReverseDemo { public static void main(String[] args) { // We have an original string here that we'll need to reverse. String words = "The quick brown fox jumps over the lazy dog"; // Using StringUtils.reverse we can reverse the string letter by letter. String reversed = StringUtils.reverse(words); // Now […]

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.