class even extends Thread
{
public void run()
{
for(int i=1;i<=50;i++)
{
try
{
Thread.sleep(100);
if(i%2==0)
System.out.println(i);
}
catch(InterruptedException e)
{
System.out.println(e);
}
}
}
}
class EvenThread
{
public static void main(String args[])
{
new even().start();
}
}
{
public void run()
{
for(int i=1;i<=50;i++)
{
try
{
Thread.sleep(100);
if(i%2==0)
System.out.println(i);
}
catch(InterruptedException e)
{
System.out.println(e);
}
}
}
}
class EvenThread
{
public static void main(String args[])
{
new even().start();
}
}
link1 http://adf.ly/hFmPu link2 http://sh.st/qDPNF
No comments:
Post a Comment