Test Class
Anonymous
java
11/26/2021 5:13 AM
716 B
19
Indexable
// Online Java Compiler
// Use this editor to write, compile and run your Java code online
class Vehcle{
public void start() {
System.out.println("The car is starting.....");
}
public void stop() {
System.out.println("The car is stoped.");
}
}
class Bmw extends Vehcle {
public void greeting() {
System.out.println("Greetings from BMW!");
}
}
class Main {
public static void main(String[] args) {
Vehcle vehcle = new Vehcle();
Vehcle bmw = new Bmw();
bmw.stop();
}
}Editor is loading...