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 API28 Mei 2006

How do I delete a file in Java?

In this example you will see how to delete a file in Java. To delete a file we start by creating a File object that represent the file to be deleted. We use the exists() method to check if the file is exists before we try to delete it. To delete the file we call […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API25 Mei 2006

How do I get IP address of localhost?

The example here show you how to get an IP or host address using the java.net.InetAddress class. To get an instance of InetAddress we call a static method of this class, the method is getLocalHost(), which return the local host address. Next, to get the IP address we can call the getHostAddress() method. package org.kodejava.net; […]

Wayan · 1 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
CORE API / CATATAN</>
Core API17 Mei 2006

How do I create an empty collection object?

Sometimes you need to return an empty collection from your Java methods. The java.util.Collections utility class have three different static constants for creating empty List, Set and Map. Collections.EMPTY_LIST Collections.EMPTY_SET Collections.EMPTY_MAP There are also methods when you want to create type-safe empty collections. Collections.emptyList() Collections.emptySet() Collections.emptyMap() Bellow it the code example. package org.kodejava.util; import java.util.*; […]

Wayan · 1 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

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.