import
java.util.*;
import java.util.Scanner;
class Print_Numerics extends Thread
{
Thread t;
Print_Numerics()
{
super();
}
public void run()
{
for(int
i=1;i<=10;i++)
{
if(i%2!=0)
{System.out.println(i);}
}
}
}
class E10A
{
public static void main(String args[])
{
Print_Numerics ob1 = new Print_Numerics();
Print_Numerics ob2 = new Print_Numerics();
ob1.start();
ob2.start();
}
}
OUPUT
F:\java
program\OOPM>javac E10A.java
F:\java
program\OOPM>java E10A
1
3
5
7
9
1
3
5
7
9
No comments:
Post a Comment