Getting runtime time error :- Error: Main method not found in class languagefundament.Vehicle, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application
Programming done in Java for Abstract class and Abstract method ut while running error comes,
Kindly explain where it has went wrong as i am new to programming and watching lecture on youtube
package languagefundament;
abstract class Vehicle
{
abstract public int getNoofwheels();
}
class Bus extends Vehicle
{
public int getNoofwheels()
{
return 7;
}
public static void main(String[] args)
{
Bus a = new Bus();
System.out.println(a.getNoofwheels());
}
}
main()function always need to be in a public class. - LenglBoy