fork download
  1. class Ideone {
  2. public static void main(String[] args) throws Exception {
  3. new X();
  4. }
  5. }
  6.  
  7. abstract class Y {
  8. private int x = 100;
  9.  
  10. Y(int v) {
  11. x = v;
  12. announce();
  13. }
  14.  
  15. abstract void announce();
  16. }
  17.  
  18. class X extends Y {
  19. private int x = 300;
  20.  
  21. X() {
  22. super(200);
  23. }
  24.  
  25. void announce() {
  26. System.out.println("x is " + x);
  27. }
  28. }
  29.  
Success #stdin #stdout 0.12s 53540KB
stdin
Standard input is empty
stdout
x is 0