Recent Posts
- NCC Punjab LDC Results 2013 NCCPunjab.com Interview Selected Candidates List
- RGUHS PGSSET Super Speciality 2013 Exam www.logisys.net.in Online Application
- RKCL RS-CIT Results 2013 rkcl.in RSCIT Final Exam May Result 2013
- TNEB Electricity Bills Online Payment tnebnet.org/awp/login Tamilnadu EB Payment System
- Kerala LET 2013 Fee Structure for 2013-14 Engineering College Admission
Discussion Forum
Java Threads Implements Runnable Example Program
You can get Java code for Threads class implements runnable program. You can get the example program for Java Threads Implements Runnable.
You can get Java code for Threads class implements runnable program. You can get the example program for Java Threads Implements Runnable.
class PrintNameRunnable implements Runnable {
public PrintNameRunnable(){
System.out.println(“New Thread started”);
}
public void run() {
for (int i = 0; i < 50; i++) {
System.out.print(i+” ”);
}
}
}
public class ImplementRunnable1 {
public static void main(String args[]) {
PrintNameRunnable pnt1 = new PrintNameRunnable ();
Thread t1 = new Thread(pnt1);
t1.start();
PrintNameRunnable pnt2 = new PrintNameRunnable ();
Thread t2 = new Thread(pnt2);
t2.start();
}
}
Result:
New Thread started
New Thread started
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
