/**
 * This program demonstrates the use of super in a constructor
 * to call a constructor of the superclass, and also that superclass
 * constructors are called automatically.  Try removing the "super(t)"
 * from the first constructor of Bar2 and see what happens.
 */

public class ShowConstructorSuper {
   public static void main(String[] args) {
      System.out.println(new Bar().lunch);
      System.out.println(new Bar("ham").lunch);
   }  
}

class Foo {
   String lunch;
   
   Foo() {
      lunch = "turkey";
   }
   
   Foo(String s) {
      lunch = s;
   }
}

class Bar extends Foo {
   Bar(String t) {
      super(t);
      lunch += " sandwich";
   }
   
   Bar() {
      lunch += " sandwich";
   }
}