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.

NET PACKAGE / CATATAN</>
Net Package11 Agt 2025

How to Get Hostname and IP Address in Java

Here are the most common and reliable ways to get hostnames and IP addresses in Java (Java 21). Pick the approach that matches your runtime (desktop app, server app, behind proxy, etc.). Quick local host info Good for simple cases, but can return 127.0.0.1 if your host isn’t configured in DNS/hosts. import java.net.InetAddress; public class […]

Wayan · 4 menit baca
NET PACKAGE / CATATAN</>
Net Package09 Agt 2025

How to Build a Simple Web Server in Java

Building a simple web server in Java involves creating a server socket to listen on a specific port, accepting client requests, and sending responses back to the client. Below is a basic example of building a simple HTTP server in Java. Example Code package org.kodejava.net; import java.io.*; import java.net.*; public class SimpleWebServer { public static […]

Wayan · 3 menit baca
JAVA DATE TIME API / CATATAN</>
Java Date Time API08 Agt 2025

How to Check If a Date Is Weekend in Java

Here are simple and reliable ways to check whether a date falls on a weekend in Java. Prefer the modern java.time API (Java 8+), which is clearer and thread-safe. Using LocalDate (recommended) import java.time.DayOfWeek; import java.time.LocalDate; public class WeekendChecker { public static boolean isWeekend(LocalDate date) { DayOfWeek dow = date.getDayOfWeek(); return dow == DayOfWeek.SATURDAY || […]

Wayan · 2 menit baca
JAVA DATE TIME API / CATATAN</>
Java Date Time API07 Agt 2025

How to Convert Between Date and LocalDateTime

In Java, you can convert between java.util.Date and java.time.LocalDateTime using the java.time API introduced in Java 8. Here’s how you can perform the conversions: 1. Converting Date to LocalDateTime You need to use java.time.Instant and java.time.ZoneId to make this conversion. Here’s the process: package org.kodejava.datetime; import java.time.LocalDateTime; import java.time.ZoneId; import java.util.Date; public class DateToLocalDateTimeExample { […]

Wayan · 2 menit baca
JAVA DATE TIME API / CATATAN</>
Java Date Time API06 Agt 2025

How to Calculate Date Differences Using ChronoUnit

You can calculate date differences in Java using the ChronoUnit enum from the java.time package. The ChronoUnit class is used to measure the amount of time between two temporal objects (e.g., LocalDate, LocalDateTime, etc.) in terms of specific time units like DAYS, MONTHS, YEARS, etc. Here’s an example of how to calculate the difference between […]

Wayan · 3 menit baca
IO / CATATAN</>
IO05 Agt 2025

How to Read Binary Files into Byte Arrays

To read a binary file into a byte array in Java, you can use various ways such as Files.readAllBytes(), FileInputStream, or DataInputStream. Below is an explanation of the most common methods. Using Files.readAllBytes() (Java NIO) This is the simplest and most efficient way if you’re using Java 7 or later. The Files.readAllBytes() method reads all […]

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