// Short program that has 2 classes. // The second class is extended from the first class. // The extended class calls a method from the first class. // Distributed under the GPL: www.gnu.org/licenses/gpl.html class Alpha { public void firstMethod() { System.out.println("First method executing in class Alpha."); } // end firstMethod() public static void main(String[] args) { Alpha x = new Alpha(); x.firstMethod(); } // end main method } // end class Alpha public class Bravo extends Alpha { public void secondMethod() { System.out.println("Second method executing in class Bravo."); } // end secondMethod() public static void main(String[] args) { Bravo z = new Bravo(); System.out.println("Calling first method from class Alpha."); z.firstMethod(); System.out.println("Calling method from class Bravo."); z.secondMethod(); System.out.println("Testing and Executing class Alpha."); Alpha.main(args); } // end main method } // end class Bravo