Write a program to create multiple threads in java
class
A extends Thread
{
public
void run()
{
for(int
i=0;i<=5;i++)
{
System.out.println("value
of i" + i);
}
}
}
class
B extends Thread
{
public
void run()
{
for(int
j=0;j<=5;j++)
{
System.out.println("value
of j" + j);
}
}
}
class
C extends Thread
{
public
void run()
{
for(int
k=0;k<=5;k++)
{
System.out.println("value
of k" + k);
}
}
}
public
class mltithrd {
public static void
main(String[] args) {
A a = new A();
a.start();
new B().start();
C c = new C();
c.start();
}
}
Output