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.

BASIC / NOTES</>↗
Basic07 Jan 2024

What are Static Methods on interface in Java?

In Java SE 8 and later, you can define static methods on interfaces. A static method is a method associated with the class, not the instance. This means you can call a static method without creating an instance of the class. This feature can be particularly useful when providing utility methods that act on instances […]

Wayan · 2 min read
2D API / NOTES</>↗
2D API07 Jan 2024

How do I write a simple analog clock using Java 2D?

Here is a simple Java code for an analog clock using Java 2D features in Swing. Please adjust the code according to your needs. This code will create a new JFrame and continually update it every second with the current time. package org.kodejava.swing; import javax.swing.*; import java.awt.*; import java.util.Calendar; import java.util.GregorianCalendar; public class AnalogClock extends […]

Wayan · 3 min read
BASIC / NOTES</>↗
Basic07 Jan 2024

What is Default Methods in Java?

Default methods are a feature introduced in Java 8, allowing the declaration of methods in interfaces, apart from abstract methods. They are also known as defender methods or virtual extension methods. With the use of default keyword, these methods are defined within the interface and provide a default implementation. This means they can be directly […]

Wayan · 3 min read
BASIC / NOTES</>↗
Basic06 Jan 2024

What is a Functional Interface in Java?

A Functional Interface in Java is an interface that has exactly one abstract method. Apart from this abstract method, it can include default and static methods. Java 8 introduced the @FunctionalInterface annotation to ensure an interface follows the rules of Functional Interface. It’s optional but good practice to use this annotation. Functional interfaces are extensively […]

Wayan · 6 min read
CORE API / NOTES</>↗
Core API04 Jan 2024

How do I read a file line by line using Java NIO?

The java.nio.file.Files.lines() method is a Java NIO method used to read the contents of a file line by line. The code snippet will read the file from the specified filePath and print each line to the console. The Files.lines() method returns a Stream of strings, and we use Stream’s forEach method to print each line. […]

Wayan · 3 min read
BASIC / NOTES</>↗
Basic29 Dec 2023

What are Method References in Java?

Method references in Java are a feature that was introduced in Java 8. They provide a way to refer to a method without actually executing it. They are often used in conjunction with Java’s functional programming features, such as Streams and Lambdas, where a method to be executed is often expected as a parameter. The […]

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