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. sample program in packages and interface combined
View Tutorial          By: priya at 2009-09-10 05:42:31

2. I am not able to open the rar file, can you please
View Tutorial          By: Chandra at 2008-08-07 10:35:59

3. Cant be compiled, i got error with this msg:. cann
View Tutorial          By: ken at 2011-04-17 04:32:36

4. Caught java.lang.ClassNotFoundException: com.sun.c
View Tutorial          By: A.Balaji at 2010-09-13 00:15:48

5. I need JSP Code to send SMS to mobile.
View Tutorial          By: nana at 2010-03-12 22:43:22

6. really nice
View Tutorial          By: umer at 2011-06-25 06:35:19

7. Great tutorial
View Tutorial          By: Stephen at 2014-07-21 12:08:32

8. click the line which is shown in this site:

View Tutorial          By: hi to get 5 files at 2010-09-22 03:10:36

9. its very nice
View Tutorial          By: keerthi at 2012-06-28 17:04:36

10. thanks for your code
could you send me the

View Tutorial          By: diana jeng at 2009-04-21 03:50:39