Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

hello we are facing can't find main(String[]) method in class: Vehicle that type of error

User_8R093May 23 2022 — edited May 23 2022

class Vehicle {
protected String brand = "Ford";
public void honk() {
System.out.println("Tuut, tuut!");
}
}

class Car extends Vehicle {
private String modelName = "Mustang";
public static void main(String[] args) {
Car myFastCar = new Car();
myFastCar.honk();
System.out.println(myFastCar.brand + " " + myFastCar.modelName);
}
}
this is the proggram
that run on the online compiler and mac also but not run windows 10
Screen Shot 2022-05-23 at 3.05.48 PM.png

Comments

Post Details

Added on May 23 2022
2 comments
3,704 views