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

How do I use StringTokenizer to split a string?

The code below is an example of using StringTokenizer to split a string. In the current JDK this class is discouraged to be used, use the String.split(…) method instead or using the new java.util.regex package. package org.kodejava.util; import java.util.StringTokenizer; public class StringTokenizerExample { public static void main(String[] args) { StringTokenizer st = new StringTokenizer("A StringTokenizer […]

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

How do I check a string starts with a specific word?

To test if a string starts with a specific prefix we can use the String.startsWith(String prefix) method. This method returns a boolean true as the result if the string starts with that specified prefix. The String.startsWith() method checks the prefix in case-sensitive manner. The following code snippet give us a small example how to use […]

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

How do I check a string ends with a specific word?

The String.endsWith() method can be used to check if a string ends with a specific word. It will return a boolean true if the suffix is found at the end of the string object. In this example we will start the code by creating a class called StringEndsWithExample. This class has a standard main() method […]

Wayan · 2 min read
CREATIONAL PATTERNS / NOTES</>↗
Creational Patterns31 Jan 2006

How do I implement a Singleton pattern?

Singleton Pattern is used when we want to allow only a single instance of a class can be created inside our application. This pattern ensures that a class only have a single instance by protecting the class creation process, which can be done by defining the class constructor with private access modifier. To get an […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API28 Jan 2006

How do I know the length of a string?

To get the length of a String object we can use the String.length() method. This method returns the string length as an int value. The length of the string is equals to the length of the sequence of characters represented by this string object, and it is equals to the number of 16-bit Unicode characters […]

Wayan · 2 min read
CORE API / NOTES</>↗
Core API25 Jan 2006

How do I check string for equality?

To compare strings for their content equality we must use the String.equals() method. This method ensures that it will compare the content of both string instead of the object reference of the both string. This method returns true if both string in comparison have the same content. Do not, never, use the == operator 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.