class ThreadTest2 {
	public static void main(String [] args) {
		PingPong2  ping = new PingPong2("PING",2);
		PingPong2  pong = new PingPong2("pong",4);
		ping.start();
		pong.start();
		for(int i=0;i<100;i++)
			System.out.print(i + " ");
		ping.stop();
		pong.stop();
		}
	}

class PingPong2 extends Thread {
	String word;		// λέξη για εκτύπωση
	int delay;			// χρόνος ανάπαυλας

	PingPong2(String wordToPrint, int pauseTime){
		word = wordToPrint;
		delay = pauseTime;
		}

	public void run() {

			for(int i=0;i<30;i++)
				System.out.print(word +"-" + i + " ");

		}
	}
