Make your own free website on Tripod.com
 1:import test.*;
 2:public class testm extends testclass
 3:{
 4:  public static void main(String arg[])
 5:  {
 6:    testm t = new testm();
 7:    t.onemethod(); //can call all methods because within class
 8:    t.defmethod();
 9:    t.promethod();
10:    //((testclass)t).defmethod(); //this guy exists but cant be accessed because private will cause error
11:   }
12:
13:   public void onemethod() { System.out.println("new one method" ); }
14:   private void defmethod() {System.out.println("new def");         } //overriding private method!!
15:   public void promethod() {System.out.println("new pro"); }
16:}
17:
18: