fork download
  1. class Main {
  2. public static void main( String[] args ) {
  3. ABC obj = new XYZ();
  4. System.out.println(((XYZ) obj).getXYZ());
  5. }
  6. }
  7.  
  8. class ABC {
  9. int x = 0;
  10. public int getABC() {
  11. return x;
  12. }
  13. }
  14.  
  15. class XYZ extends ABC {
  16. int y = 0;
  17. public int getXYZ() {
  18. return y;
  19. }
  20. }
  21.  
  22. //https://pt.stackoverflow.com/q/453005/101
Success #stdin #stdout 0.06s 32388KB
stdin
Standard input is empty
stdout
0