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 Commons05 Agt 2006

How do I check if a string is empty or not?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class EmptyStringCheckDemo { public static void main(String[] args) { // Create some variable to hold some empty string, contains only // whitespaces and words. String one = ""; String two = "\t\r\n"; String three = " "; String four = null; String five = "four four two"; // We can […]

Wayan · 2 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons22 Mei 2006

How do I implement equals() method using EqualsBuilder class?

This code snippet show you how to use HashCodeBuilder and EqualsBuilder class from the Apache Commons Lang library to implement the hashCode() and equals() method of an object. To use both of these classes, we just need to create instance of these classes and append the properties that we will use to calculate the hashcode […]

Wayan · 3 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons17 Mei 2006

How do I implement hashCode() method using HashCodeBuilder class?

package org.kodejava.commons.lang; public class ObjectHashCodeDemo { public static void main(String[] args) { Book book1 = new Book(1L, "Spring Boot in Action", "Craig Walls"); Book book2 = new Book(2L, "Docker in Action", "Jeff Nickoloff"); Book book3 = book1; System.out.println("book1.hashCode() = " + book1.hashCode()); System.out.println("book2.hashCode() = " + book2.hashCode()); System.out.println("book3.hashCode() = " + book3.hashCode()); } } package […]

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

How do I write string data to file?

The following code snippet shows you how to write strings of data into a file using the Apache Commons IO library. We can use the FileUtils.writeStringToFile() method to do it. This method accepts the file object where the data will be stored, the data itself, and the encoding. package org.kodejava.commons.io; import org.apache.commons.io.FileUtils; import java.io.File; import […]

Wayan · 1 menit baca
APACHE COMMONS / CATATAN</>
Apache Commons12 Mei 2006

How do I calculate directory size?

In this example, we are going to use the Apache Commons IO library to get or calculate the total size of a directory. The FileUtils class provided by the Commons IO can help us to achieve this goal. The first method that we can use is the FileUtils.sizeOfDirectory(), it calculates the size of a directory […]

Wayan · 2 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.