Abstract class

Run Settings
LanguageJava
Language Version
Run Command
abstract class Vehicle{ String name; public String getName(){ return "Vehicle name:" + name; } } class Car extends Vehicle{ public Car(String val){ name = val; } public String getName(String val){ return "Car name:" + val; } } class Main { public static void main(String[] args) { Vehicle vehicle = new Car("IONIQ5"); System.out.println(vehicle.getName()); Car kiaCar = new Car("EV6"); System.out.println(kiaCar.getName("GENESIS")); } }
Editor Settings
Theme
Key bindings
Full width
Lines