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 API19 Feb 2006

How do I get date, month, year values from the current date?

What date, month, year, day-of-week, day-of-month, day-of-year is it today? If we want to answer these question we can use java.util.Calendar and java.util.GregorianCalendar which is the implementation of Calendar abstract class. These classes can help us to get integer value such as date, month, year from a Date object. Let’s see the example code. package […]

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

How do I get the minimum and maximum value of a primitive data types?

To get the minimum or maximum value of a primitive data types such as byte, short, int, long, float and double we can use the wrapper class provided for each of them, the wrapper classes are Byte, Short, Integer, Long, Float and Double which is located in java.lang package. package org.kodejava.lang; public class MinMaxExample { […]

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

How do I convert String into Date Object in Java?

The following code shows how we can convert a string representation of date into java.util.Date object. To convert a string of date we can use the help from java.text.SimpleDateFormat that extends java.text.DateFormat abstract class. package org.kodejava.text; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Date; public class ConvertStringTo...

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

How do I compare if two arrays are equal?

Using Arrays.equals() methods we can compare if two arrays are equal. Two arrays are considered to be equal if their length, each element in both arrays are equal and in the same order to one another. package org.kodejava.util; import java.util.Arrays; public class CompareArrayExample { public static void main(String[] args) { String[] abc = {"Kode", "Java", […]

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

How do I convert primitive data types into String?

There are times when we want to convert data from primitive data types into a string, for instance when we want to format output on the screen or simply mixing it with other string. Using a various static method String.valueOf() we can get a string value of them. Here is the code sample: package org.kodejava.lang; […]

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

How do I create a repeated sequence of character?

This example shows you how to create a repeated sequence of characters. To do this, we use the Arrays.fill() method. This method fills an array of char with a character. package org.kodejava.util; import java.util.Arrays; public class RepeatCharacterExample { public static void main(String[] args) { char c = '*'; int length = 10; // creates a […]

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