Java 2004 — A Tour for the Midrange Developer

G

Java Language Syntax ( J2SE 1.4 )

Home

Code Example — EmpTest.java

public class EmpTest { Employee[] ae; public EmpTest() { ae = new Employee[ 3 ]; ae[0] = new CommissionedEmployee( 105 ); ae[1] = new HourlyEmployee( 205 ); ae[2] = new SalariedEmployee( 305 ); } // end constructor public void identify() { for( int i = 0; i < ae.length; i++ ) { System.out.println( ae[ i ] ); } } // end identify() public static void main( String[] args ) { EmpTest et = new EmpTest(); et.identify(); } // end main } // end class EmpTest


Home