Source of TeaAndCoffee.java


  1: //TeaAndCoffe.java

  3: class Tea extends Thread
  4: {
  5:     public void run()
  6:     {
  7:         System.out.println("I like tea!");
  8:     }
  9: }

 11: class Coffee extends Thread
 12: {
 13:     public void run()
 14:     {
 15:         System.out.println("I like coffee!");
 16:     }
 17: }

 19: class TeaAndCoffee
 20: {
 21:     public static void main(String[] args)
 22:     {
 23:         new Tea().start();
 24:         new Coffee().start();
 25:     }
 26: }