import java.util.*;
public class Tshow{
Runnable r1 = new t1();
Runnable r2 = new t2();
Thread th1 = new Thread(r1);
Thread th2 = new Thread(r2);
public void GetInts() throws Exception{
System.out.println("Int1=" + Integer.toString(((t1)r1).getX()) + "/t/tIntY=" + Integer.toString(((t2)r2).getY()));
Thread.sleep(100);
GetInts();
}
public void loop(){
try{
th1.start();
th2.start();
GetInts();
}catch(Exception e){System.out.println(e);}
}
public static void main(String agrt[]){
Tshow k = new Tshow();
k.loop();
}
}
class t1 implements Runnable{
int intX = 0;
public void run(){
try{
intX++;
Thread.sleep(300);
run();
}catch(Exception e){}
}
public int getX(){
return intX;
}
}
class t2 implements Runnable{
int intY = 1000000;
public void run(){
try{
intY--;
Thread.sleep(100);
run();
}catch(Exception e){}
}
public int getY(){
return intY;
}
}