Test Class

mail@pastecode.io avatar
unknown
java
2 years ago
536 B
5
Indexable
Never
// 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();
  }
}