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.

CORE API / NOTES</>↗
Core API08 Mar 2006

How do I read a configuration file using java.util.Properties?

When we have an application that used a text file to store a configuration, and the configuration is typically in a key=value format then we can use java.util.Properties to read that configuration file. Here is an example of a configuration file called app.config: app.name=Properties Sample Code app.version=1.0 The code below show you how to read […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API06 Mar 2006

How do I convert a collection object into an array?

To convert collection-based object into an array we can use toArray() or toArray(T[] a) method provided by the implementation of Collection interface such as java.util.ArrayList. package org.kodejava.util; import java.util.List; import java.util.ArrayList; public class CollectionToArrayExample { public static void main(String[] args) { List<String> words = new ArrayList<>(); words.add("Kode"); words.add("Java"); words.add("-"); words.add("Learn"); words.add("Java"); words.add...

Wayan · 1 min read
CORE API / NOTES</>↗
Core API02 Mar 2006

How do I convert an array into a collection object?

To convert array based data into List / Collection based we can use java.util.Arrays class. This class provides a static method asList(T… a) that converts array into List / Collection. package org.kodejava.util; import java.util.Arrays; import java.util.List; public class ArrayAsListExample { public static void main(String[] args) { String[] words = {"Happy", "New", "Year", "2021"}; List<String> list […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API28 Feb 2006

How do I add or subtract a date?

The java.util.Calendar allows us to do a date arithmetic function such as add or subtract a unit of time to the specified date field. The method that done this process is the Calendar.add(int field, int amount). Where the value of the field can be Calendar.DATE, Calendar.MONTH, Calendar.YEAR. So this mean if you want to subtract […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API24 Feb 2006

How do I get the current month name?

To get the current month name from the system we can use java.util.Calendar class. The Calendar.get(Calendar.MONTH) returns the month value as an integer starting from 0 as the first month and 11 as the last month. This mean January equals to 0, February equals to 1 and December equals to 11. Let’s see the code […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API20 Feb 2006

How do I check if a string is a valid number?

When building a computer program we will use a lot of string to represent our data. The data might not just information about our customer name, email or address, but will also contain numeric data represented as string. So how do we know if this string contains a valid number? Java provides some wrappers to […]

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