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 Nov 2010

How do I check if a thread is alive?

A thread is alive or running if it has been started and has not yet died. To check whether a thread is alive use the isAlive() method of Thread class. It will return true if this thread is alive, otherwise return false. package org.kodejava.lang; public class ThreadAliveDemo implements Runnable { public static void main(String[] args) […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API06 Nov 2010

How do I check if a thread is a daemon thread?

You can test if a thread is a daemon thread or a user thread by calling the isDaemon() method of the Thread class. If it returns true then the thread is a daemon thread, otherwise it is a user thread. package org.kodejava.lang; public class ThreadCheckDaemon implements Runnable { public static void main(String[] args) { Thread […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API06 Nov 2010

How do I create a daemon thread?

A daemon thread is simply a background thread that is subordinate to the thread that creates it, so when the thread that created the daemon thread ends, the daemon thread dies with it. A thread that is not a daemon thread is called a user thread. To create a daemon thread, call setDaemon() method with […]

Wayan · 1 min read
CORE API / NOTES</>↗
Core API05 Nov 2010

How do I use the sleep method of the Thread class?

Here is another example that use the Thread.sleep() method. In the example we create two instances of the ThreadSleepAnotherDemo, we give each thread a name and the sleep interval so that we can see how to thread execution. package org.kodejava.lang; import java.util.Calendar; public class ThreadSleep implements Runnable { private final String threadName; private final long […]

Wayan · 2 min read
REGEX / NOTES</>↗
Regex05 Nov 2010

How do I count the number of capturing groups?

Capturing groups are numbered by counting the opening parentheses from left to right. To find out how many groups are present in the expression, call the groupCount() method on a matcher object. The groupCount() method returns an int showing the number of capturing groups present in the matcher’s pattern. package org.kodejava.example.regex; import java.util.regex.Matcher; import java.util.regex.Pattern; […]

Wayan · 2 min read
REGEX / NOTES</>↗
Regex05 Nov 2010

How do I compile character classes with quantifier?

This example show you how to attach quantifier to character classes or capturing group in regular expressions. package org.kodejava.example.regex; import java.util.regex.Pattern; import java.util.regex.Matcher; public class CombineWithQuantifier { public static void main(String[] args) { // [abc]{3} –> apply quantifier in character class. // Find 'a' or 'b' or 'c', three times in a row. // // […]

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.