Threads in java
A small program that shows THREADS in action.
public class TwoThread extends Thread {
public void run() {
for (int i = 0; i < 10; i++) {
System.out.println(“New thread”);
}
} public static void main(String[] args) {
TwoThread tt = new TwoThread();
tt.start();
for (int i = 0; i < 10; i++) {
System.out.println(“Main thread”);
}
}
}
Related posts:
- THREADS IN JAVA
- JAVA Tutorial
- JAVA Tutorial II
- Java interview questions
- C# simple console application
- JAVA Simple Tutorial Part-I
