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. A good short article on Struts. Require a step by
View Tutorial          By: Atul Saxena at 2012-01-09 19:56:59

2. Article is good but really lacks somewhat clarity
View Tutorial          By: Ashwin Perti at 2009-09-14 04:02:39

3. I am getting error in setContentView(R.layout.main
View Tutorial          By: user at 2012-01-13 06:49:42

4. Hi
i am getting this error

c

View Tutorial          By: parab at 2012-08-01 06:24:18

5. i have to learn java
View Tutorial          By: md arif alam at 2013-04-15 18:30:27

6. not that much clear exampl.. you should explain it
View Tutorial          By: elangovan at 2010-06-09 02:36:19

7. hello,
i have to connect the crystal report

View Tutorial          By: shanmugaraj at 2010-03-03 04:08:30

8. I get theses errors and apparrently it cannot find
View Tutorial          By: Abhaya at 2013-02-20 22:42:18

9. Hello to Every one!! :-),HERE I'AM NOT WRITING A C
View Tutorial          By: Pulkit Malviya at 2012-08-26 14:56:18

10. Very useful and simple.
Thanks.

View Tutorial          By: harsh at 2014-11-06 10:01:22