in this tutorial we are learn about multithreading in java.
multithreading in java:- it is a java features that allow to two or more parts of a current programming execution for maximum utilization of CPU. that parts of program is called thread.so thread is light weight processes.
basically multithreading is a divide the execution of processes in small part that called thread and combine execution of this thread is called multithreading.
Code:
class mythread implements Runnable {
public void run()
{
System.out.println("current Thread started running...");
}
}
class implethread
{
public static void main(String[] args) { mythread mt=new mythread(); Thread t=new Thread(mt); t.start();
}
}
Output:-
0 Comments