Java写的源程序,怎样在JBuilder里实现呢?100分求教,只因时间紧,没空看书
以前没有用过JBuilder,现在有Java源程序,我在JDK1.4下编译运行通过。现在想在JBuilder上实现,因为时间紧,我现在又不可能发太多时间在JBuilder上,所以想请教,具体实现步骤,请提示,多谢。最好能写明操作流程。多谢。
程序如下:
public class Example19_1
{ public static void main(String args[])
{ Lefthand left;
Righthand right;
left=new Lefthand() ;//创建线程。
right=new Righthand();
left.start(); //线程开始运行后,Lefthand类中的run方法将被执行。
right.start();
}
}
class Lefthand extends Thread
{ public void run()
{ for(int i=1;i<=5;i++)
{ System.out.print("A");
try {
sleep(500);
}
catch(InterruptedException e){}
}
}
}
class Righthand extends Thread
{ public void run()
{ for(int i=1;i<=5;i++)
{ System.out.print("B");
try{ sleep(300);
}
catch(InterruptedException e){}
}
}
}