class NumberThread extends Thread
{
public void run()
{
for (int i = 100; i >= 1; i--)
{
System.out.println("Number: " + i);
try {
Thread.sleep(100);
}
catch (InterruptedException e)
{
e.printStackTrace();
} } }}
class AlphabetThread extends Thread
{
public void run() {
for (char ch = 'a'; ch <= 'z'; ch++)
{
System.out.println("Alphabet: " + ch);
try
{
Thread.sleep(100);
}
catch (InterruptedException e)
{
e.printStackTrace();
} } }}
class VowelThread extends Thread {
public void run() {
char[] vowels = {'a', 'e', 'i', 'o', 'u'};
for (char v : vowels) {
System.out.println("Vowel: " + v);
try
{
Thread.sleep(200);
}
catch (InterruptedException e)
{ e.printStackTrace(); } } }}
public class MultiThreadExample
{
public static void main(String[] args) {
NumberThread t1 = new NumberThread();
AlphabetThread t2 = new AlphabetThread();
VowelThread t3 = new VowelThread();
t1.start();
t2.start();
t3.start();
} }