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
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
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
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program 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
Archived Comments
1. Hey thanks for your tutorial. But i'm getting an e
View Tutorial By: acc at 2013-07-25 14:30:50
2. thanks man really very nice and helpful...........
View Tutorial By: Bakhtawar khan at 2012-12-05 05:54:18
3. import java.io.*;
import java.util.Stack;
View Tutorial By: jack&jill at 2011-07-26 06:40:32
4. How can I store a file in device internal memory a
View Tutorial By: Fabio at 2014-11-20 11:25:41
5. Hello,
I've got javax.comm and fol
View Tutorial By: Ashkan at 2009-12-19 21:51:19
6. Thanks for your nice article.I learned a lot
View Tutorial By: Mahyar at 2012-08-12 12:09:36
7. This explanation is simple and very useful.
View Tutorial By: kiran at 2015-02-22 20:47:13
8. realy it was a nice basic example...and better def
View Tutorial By: amit kumar at 2011-03-14 08:11:31
9. Can you please send me complete sample code of cha
View Tutorial By: Brajesh at 2011-04-21 05:48:17
10. Good one.....
View Tutorial By: Ratnam.. at 2012-07-03 07:11:26