TThread2.java
Select all
public class TThread2 { public static void main( String args[] ) { PThread t1, t2; t1 = new PThread(); t2 = new PThread(); System.out.println( "Starting threads" ); t1.start(); t2.start(); System.out.println( "Threads started" ); System.out.println( "Mainline finished" ); } } class PThread extends Thread { public PThread() { System.out.println( "Name: " + getName() + " being created"); } public void run() { System.out.println( getName() + " finished" ); } }