Ruang penulis
SEBUAH JURNAL TENTANG TEKNOLOGI

Belajar hal baru.
Tulis. Bagikan.

Ruang untuk merangkai pengetahuan, satu baris kode setiap hari.
Temukan tutorial, ide, dan catatan dari perjalanan belajar.

1914 catatan & terus bertumbuh
PILIHAN EDITOR
Java

Memahami Java Stream: olah koleksi dengan lebih ringkas

Pelajari alur filter, map, dan collect untuk mengolah data Java dengan kode yang mudah dibaca.

D Tim Diary Coding · 1 menit baca
UNTUK RASA INGIN TAHUMU

Catatan terbaru.

CORE API / CATATAN</>
Core API14 Agt 2011

How do I count active thread in a thread group?

This example describe how to get the number of active threads in this thread group. The result might not reflect concurrent activity, and might be affected by the presence of certain system threads. Due to the inherently imprecise nature of the result, it is recommended that this method only be used for informational purposes. package […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API14 Agt 2011

How do I get number of active thread in current thread?

In this example you’ll see how to obtain the number of active thread in the current thread. You can use the Thread.activeCount() method to get this information. package org.kodejava.lang; public class CountActiveThread { public static void main(String[] args) { Thread t = new Thread(() -> System.out.println("Hello…")); t.start(); // Get the number of active threads in […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API14 Agt 2011

How do I get number of active thread group?

Use method activeGroupCount() of ThreadGroup class to get estimate number of active groups in the thread group and use activeCount() to get estimate number of active threads in a thread group. package org.kodejava.lang; public class ActiveGroupCount { public static void main(String[] args) { ThreadGroup root = new ThreadGroup("RootGroup"); ThreadGroup server = new ThreadGroup(root, "ServerGroup"); ThreadGroup […]

Wayan · 2 menit baca
CORE API / CATATAN</>
Core API14 Agt 2011

How do I get thread group of a thread?

Use the getThreadGroup() method of Thread class to get the thread group to which the thread belongs. package org.kodejava.lang; public class GetThreadGroup { public static void main(String[] args) { // Create thread groups ThreadGroup group = new ThreadGroup("ThreadGroup"); ThreadGroup anotherGroup = new ThreadGroup(group, "AnotherGroup"); // Create threads and placed into thread group Thread t1 = […]

Wayan · 1 menit baca
CORE API / CATATAN</>
Core API14 Agt 2011

How do I get the state of a thread?

To get the state of a thread use getState() method of a Thread class. One thing to be noted is that this method is designed for use in monitoring of the system state, not for synchronization control. package org.kodejava.lang; public class GetThreadState implements Runnable { public static void main(String[] args) { Thread thread = new […]

Wayan · 1 menit baca
2D API / CATATAN</>
2D API13 Agt 2011

How do I draw / plot a graph?

This program read a file of data and draw a graph of the data points in the file. The graph is drawn in a window with three sections. The first section contains three buttons that initiate the program’s actions. Actions can also be initiated via control keys. The second section displays the data to be […]

Wayan · 9 menit baca

Pengetahuan tumbuh ketika dibagikan.

Simpan rasa ingin tahu. Selalu ada hal baru untuk dipelajari.

Jelajahi catatan ↗
Putu Adi Guna Permana
TENTANG PENULIS

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Penulis dan pendiri Diary Coding — berbagi catatan, tutorial, dan pengalaman seputar pemrograman untuk siapa pun yang ingin terus belajar.