1: public class Threadclass {
public static void main(
String args[])throws InterruptedException{
printall(args);
}
public static void printall(String[] lines)throws InterruptedException{
for(int i=0;i<lines.length;i++){
System.out.println(lines[i]);
Thread.currentThread().sleep(1);
}
}
}
what changes can make my print statement executed .
2
ublic class Threadclass {
public static void main(String args[]){
Threadclass t=new Threadclass();
System.out.println("1");
synchronized(args){
System.out.println("2");
try{
args.wait();
args.notify();
}catch(InterruptedException e){}
}
System.out.println("3");
}
}
how can I have 1 2 3 as output
[ January 16, 2007: Message edited by: Kasak Tahilramani ]
[ January 16, 2007: Message edited by: Kasak Tahilramani ]