inheritance

Run Settings
LanguageJava
Language Version
Run Command
class Parent{ public Parent(){ System.out.println("Parent"); } int compute(int num){ return num+1; } } class Child extends Parent{ public Child(){ System.out.println("Child"); } int compute(int num){ return num+2; } } class Main { public static void main(String[] args) { Parent obj = new Child(); System.out.println(obj.compute(3)); } }
Editor Settings
Theme
Key bindings
Full width
Lines