Slip 15 - A) Write a java program to display each alphabet after 2 seconds between ‘a’ to ‘z’.

Solution:


class Slip26 implements Runnable
{
public void run()
{
try
{
for(char c='A';c<='Z';c++)
{
System.out.println(c);
Thread.sleep(3000);
}
}
catch(Exception e)
{
System.out.println("error");
}
}
public static void main(String[] d)
{
Slip26 x=new Slip26();
Thread y=new Thread(x);
y.start();
//x.run();
}
}

Post a Comment

0 Comments