Daemon Thread
Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system.
"setDaemon" method is used to create a daemon thread.
Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system.
class MyRunnable implements Runnable
1). Threads operate on their on own copies of instance variables.
When a new Thread class is instantiated and its start method is called, system resources required for the thread are allocated. The thread is made eligible to run and must content with other threads for the CPU. When the scheduler decides to move it to the running state the run method is then executed.
The default priority when a Thread is created is 5. When a Thread is created from within a Thread, the priority will be passed on from parent to child.
The yield method provides a hint to the JVM that if there are other runnable threads, the scheduler should run one instead of the current thread. The JVM may interpret this hint in any way it likes - that is how the yield is handled is dependent on the JVM implementation for the operating system.