Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package nina;
  2.  
  3. public class poly
  4. {
  5.     public abstract class FirstLayer {
  6.         protected int aVariable;
  7.         protected abstract void bla();
  8.         public FirstLayer(int foo)
  9.         {
  10.             this.aVariable = foo;
  11.         }
  12.     }
  13.     public abstract class SecondLayer extends FirstLayer {
  14.         public SecondLayer(int foo)
  15.         {
  16.             super(foo);
  17.         }
  18.     }
  19.     public class ThirdLayer extends SecondLayer {
  20.         protected int otherVariable;
  21.         public ThirdLayer(int foo, int otherVariable)
  22.         {
  23.             super(foo);
  24.             this.otherVariable = otherVariable;
  25.         }
  26.         @Override
  27.         protected void bla()
  28.         {
  29.             System.out.println("Im doing something..");
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement