Search your topic here

program in Java to implement concurrent execution of a job using threads.

PRINCIPLES OF PROGRAMMING LANGUAGES
PRACT. Write a program in Java to implement concurrent execution of a job using threads.


class Multithreading extends Thread 
public void run() 
try
System.out.println ("Thread " + 
Thread.currentThread().getId() + 
" is running"); 
catch (Exception e) 
System.out.println ("Exception is caught"); 

 
public class Multithread 
public static void main(String[] args) 
for (int i=0; i<8; i++) 
Multithreading object = new Multithreading(); 
object.start(); 

LEAVE A REPLY










Related topics

Please use contact page in this website if you find anything incorrect or you want to share more information about the topic discussed above.