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.

APACHE COMMONS / NOTES</>↗
Apache Commons09 Aug 2006

How do I reverse a string, words or sentences?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class StringReverseDemo { public static void main(String[] args) { // We have an original string here that we'll need to reverse. String words = "The quick brown fox jumps over the lazy dog"; // Using StringUtils.reverse we can reverse the string letter by letter. String reversed = StringUtils.reverse(words); // Now […]

Wayan · 1 min read
APACHE COMMONS / NOTES</>↗
Apache Commons05 Aug 2006

How do I check if a string is empty or not?

package org.kodejava.commons.lang; import org.apache.commons.lang3.StringUtils; public class EmptyStringCheckDemo { public static void main(String[] args) { // Create some variable to hold some empty string, contains only // whitespaces and words. String one = ""; String two = "\t\r\n"; String three = " "; String four = null; String five = "four four two"; // We can […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API04 Aug 2006

How do I convert Date to String?

package org.kodejava.text; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.Calendar; import java.util.Date; public class DateToString { public static void main(String[] args) { // Create an instance of SimpleDateFormat used for formatting // the string representation of date (day/month/year) String pattern = "dd/MM/yyyy"; DateFormat df = new SimpleDateFormat(pattern); // Ge...

Wayan · 1 min read
CORE API / NOTES</>↗
Core API30 Jul 2006

How do I get day of week?

In this example we want to create a calendar or date from a year and day of the year. Next we will find out what day-of-week that calendar or date represent. In the code snippet below we are trying to find the 180 day of the year 2021. Let’s see the example below. package org.kodejava.util; […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API27 Jul 2006

How do I convert Array to Collection?

package org.kodejava.util; import java.util.Arrays; import java.util.List; public class ArrayToListExample { public static void main(String[] args) { // Creates an array of object, in this case we create an // Integer array. Integer[] numbers = {1, 1, 2, 3, 5, 8, 13, 21, 34, 55}; // Convert the created array above to collection, in this // […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API25 Jul 2006

How do I convert collection to ArrayList?

package org.kodejava.util; import java.util.ArrayList; import java.util.LinkedList; public class CollectionToArrayList { public static void main(String[] args) { // We create LinkedList collection type at put some values // in it. Here we put A, B, C and D letter into it. LinkedList<String> linkedList = new LinkedList<>(); linkedList.push("A"); linkedList.push("B"); linkedList.push("C"); linkedList.push("D"); // Let say you want to […]

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.