fork download
  1. class Vehicle
  2. {
  3. int maxSpeed = 120;
  4. }
  5. class Car extends Vehicle
  6. {
  7. int maxSpeed = 180;
  8. void display()
  9. {
  10. System.out.println(super.maxSpeed);
  11. }
  12. }
  13. class Test
  14. {
  15. public static void main(String[] args)
  16. {
  17. Car c = new Car();
  18. c.display();
  19. }
  20. }
Success #stdin #stdout 0.06s 32460KB
stdin
Standard input is empty
stdout
120