ariestamirra

derived

May 14th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. public class Derived extends Base {
  2.  
  3.     int i = -1;
  4.  
  5.     public static void main(String argv[]) {
  6.         Base b = new Derived();
  7.         System.out.println(b.i);
  8.         b.amethod();
  9.     }
  10.  
  11.     public void amethod() {
  12.         System.out.println("Derived.amethod()");
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment