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

2. I have a site fully based on php and mysql.The log
View Tutorial          By: titus at 2011-06-14 00:52:30

3. The tutorial is simple and clear.
@Gnani, i

View Tutorial          By: Tayo at 2010-01-03 13:10:24

4. Hello friends can anybody tell me how to assign in
View Tutorial          By: gnvkdramesh at 2010-09-10 04:27:46

5. i think this ist perfectly fine :) if you don't kn
View Tutorial          By: julian at 2011-03-07 05:54:08

6. Good example...easy to read and understand...
View Tutorial          By: Codventure at 2009-09-11 00:07:06

7. sir , i'm doing BCA . I want to learn more about
View Tutorial          By: gayatri patil at 2012-08-18 10:08:32

8. Shouldn't you call free() on the allocated memory
View Tutorial          By: Ritchie at 2012-05-09 14:14:49

9. Hello,

your solution is kinda overk

View Tutorial          By: Hdm-Student at 2010-06-16 08:10:51

10. i need scjp questions and information
View Tutorial          By: raja at 2010-03-29 08:05:35