2015-09-07 11:44:36 -06:00
|
|
|
// concurrency/BasicThreads.java
|
2015-06-15 17:47:35 -07:00
|
|
|
// The most basic use of the Thread class.
|
|
|
|
|
|
|
|
public class BasicThreads {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
Thread t = new Thread(new LiftOff());
|
|
|
|
t.start();
|
|
|
|
System.out.println("Waiting for LiftOff");
|
|
|
|
}
|
2015-09-07 11:44:36 -06:00
|
|
|
}
|
|
|
|
/* Output:
|
2015-06-15 17:47:35 -07:00
|
|
|
Waiting for LiftOff
|
|
|
|
#0(9), #0(8), #0(7), #0(6), #0(5), #0(4), #0(3), #0(2),
|
|
|
|
#0(1), #0(Liftoff!),
|
2015-09-07 11:44:36 -06:00
|
|
|
*/
|