}
}
class Output2 implements Runnable{
private Rec2 r;
Output2(Rec2 r){
this.r = r;
}
public void run(){
while(true){
r.get();
}
}
}
public class InputOutputDemo2 {
public static void main(String args[]){
Rec2 r = new Rec2();
new Thread(new Input2(r)).start();
new Thread(new Output2(r)).start();
}