SupportWriter space ↗
REFERENCE LIBRARY

References from other publishers

Republished articles with source attribution. This collection is separate from Diary Coding’s original guides and does not display ads.

Read original guides → · Editorial policy

FOR YOUR CURIOSITY

Latest notes.

JAVA DATE TIME API / NOTES</>↗
Java Date Time API14 Aug 2025

How to Create a Custom Date Comparator in Java

To create a custom date comparator in Java, you can follow these steps: 1. Understand the Requirements A date comparator is used to sort objects based on date values. For instance, consider a User class that has a Date field (e.g., ). We’ll compare and sort User instances by that date. birthDate 2. Define a […]

Wayan · 3 min read
UTIL PACKAGE / NOTES</>↗
Util Package13 Aug 2025

How to Use TreeMap for Sorted Key Access in Java

The TreeMap class in Java is part of the java.util package and provides an implementation of the Map interface that keeps its keys sorted in a natural order (according to ) or a custom order (defined by a Comparator, if provided during construction)Comparable. It’s commonly used when you need to access keys in sorted order […]

Wayan · 4 min read
NET PACKAGE / NOTES</>↗
Net Package12 Aug 2025

How to Encode and Decode URLs in Java

In Java, you can encode and decode URLs using the java.net.URLEncoder and java.net.URLDecoder classes. These classes handle encoding and decoding in compliance with the application/x-www-form-urlencoded MIME type. Here’s how you can encode and decode URLs: Code Example import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.net.URLDecoder; public class URLEncoderDecoderExample { public static void main(String[] args) { try { […]

Wayan · 2 min read
NET PACKAGE / NOTES</>↗
Net Package11 Aug 2025

How to Resolve a Domain Name in Java

Here are common ways to resolve domain names in Java, from simplest to more advanced use cases. Basic A/AAAA record lookup (IPv4/IPv6) Uses the system resolver and OS DNS settings. Returns all IPs (both IPv4 and IPv6 where available). import java.net.InetAddress; import java.net.UnknownHostException; public class DnsLookup { public static void main(String[] args) { String host […]

Wayan · 4 min read
NET PACKAGE / NOTES</>↗
Net Package11 Aug 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 min read
NET PACKAGE / NOTES</>↗
Net Package09 Aug 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 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.