Comment on Tutorial - A simple Thread sample in Java By Henry



Comment Added by : DeeNKHAN

Comment Added at : 2013-03-02 06:54:13

Comment on Tutorial : A simple Thread sample in Java By Henry
class Foo implements Runnable{

public void run() {
for(int i=0;i<3;i++)

System.out.println("Run by..."+Thread.currentThread().getName()+",i Is "+ i);
}
public void run(String name){

System.out.println("This is Second"+name);
}
}
public class TestingThread {

public static void main(String args [])
{
Foo f = new Foo();
Thread t = new Thread(f);
try {
System.out.println("Number Will be printt After 5 Second..");
for(int j=0;j<5;j++){
System.out.println("This is j..."+j);

t.sleep(5000);
}
}
catch(InterruptedException e) {
System.out.println("InterruptedException.."+ e);
e.printStackTrace();
}
}
}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Very nice tutorial.It helped me a lot cos i am a b
View Tutorial          By: Fara at 2011-07-01 10:53:44

2. I have initialized a int array while declaring.
View Tutorial          By: Prashanth at 2011-09-15 11:16:40

3. is anyone going to post the complete version of th
View Tutorial          By: anon at 2009-04-21 12:26:51

4. Very good explanation but i need to know how the c
View Tutorial          By: surender at 2011-11-17 11:15:22

5. thank you, this best for student like us,
View Tutorial          By: Srinath at 2012-05-12 15:04:03

6. i need to use sms and to creat using java so it is
View Tutorial          By: Abdulkerim at 2009-09-07 05:29:15

7. its not sufficient add more details..
View Tutorial          By: vikas at 2013-04-12 12:06:01

8. @ parul : check whether your are passing class fil
View Tutorial          By: heramb at 2012-03-28 07:15:21

9. great.....
View Tutorial          By: rashid at 2009-12-07 03:22:46

10. thank you....
I have a problem.
I my

View Tutorial          By: AbhiRules at 2010-08-05 20:55:27