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. This is Nice start for programmer '
Thanks

View Tutorial          By: Sagar Ikhankar at 2011-07-22 06:12:44

2. I am to learn J2ME
View Tutorial          By: ravi kumar at 2011-06-20 05:50:20

3. i have created a UI in swing now i want to read th
View Tutorial          By: Ashish Gaurkhede at 2014-09-08 08:21:04

4. Hi,
I run the program on windows (connectin

View Tutorial          By: Razvan at 2010-10-13 06:04:24

5. I very grateful with this program it expand my ide
View Tutorial          By: Nuhu Abdullahi at 2015-06-13 11:42:38

6. thanks for to solve my doubts
View Tutorial          By: puttaswamy B S at 2010-09-28 00:45:47

7. i want source code of Send SMS on Mobile by Net.
View Tutorial          By: Ankit Patel at 2011-07-05 08:43:14

8. Can i have CreateAddressBook.java?? really need it
View Tutorial          By: KIM at 2012-12-02 11:45:20

9. Very nice article. Really liked the way it took me
View Tutorial          By: Sandeep at 2010-01-10 09:58:25

10. Thanks for help
View Tutorial          By: Asha at 2014-12-20 08:25:48