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



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. thanks for to solve my doubts
View Tutorial          By: puttaswamy B S at 2010-09-28 00:45:47

2. scriptlets when used in a page - helper pattern...
View Tutorial          By: tony at 2009-03-04 17:03:03

3. hi MR. A.Balaji
can u help me how you have

View Tutorial          By: mjnanthini at 2010-10-03 23:04:35

4. please correct things....and plz dont misguide
View Tutorial          By: amit verma at 2015-02-19 08:44:55

5. Hi Guys, thanks for sharing this... I have some mo
View Tutorial          By: Fins at 2011-12-14 04:40:09

6. Thank you so much Eric Giguere.
You save me

View Tutorial          By: ijAcK D at 2009-10-18 05:02:48

7. public class zcxzcStack
{
//push fun

View Tutorial          By: eissen at 2014-09-22 13:32:20

8. Doesn't the getline() on line 14 read "once u
View Tutorial          By: poo at 2011-02-22 00:32:44

9. hi ..........
the code is worked for me....

View Tutorial          By: pradeep at 2012-01-25 06:30:14

10. Before i had lot of doubts in abstract class... no
View Tutorial          By: Mohandoss at 2012-04-02 05:08:43