<h2>
Answer:</h2>
//Declare the abstract class
//by using the "abstract" keyword as follows
abstract class Vehicle {
//declare the attributes of the class
int id;
String model;
//declare the abstract method, vehicleDetail()
//which has two arguments: id and model
//and has no implementation
abstract void vehicleDetail(int id, String model);
} //End of abstract class declaration
========================================================
//Create the Car class to inherit from the Vehicle class
//by using the "extends" keyword as follows
public class Car extends Vehicle {
//Implement the abstract method in the Vehicle class
//writing statements to print out the id and model as follows;
void vehicleDetail(int id, String model) {
System.out.println("Id : " + id);
System.out.println("Model : " + model);
} //End of vehicleDetail method
} //End of class declaration
==========================================================
//Create the Bus class to inherit from the Vehicle class
//by using the "extends" keyword as follows
public class Bus extends Vehicle {
//Implement the abstract method in the Vehicle class
//by writing statements to print out the id and model as follows;
void vehicleDetail(int id, String model) {
System.out.println("Id : " + id);
System.out.println("Model : " + model);
} //End of vehicleDetail method
} //End of class declaration
================================================================
<h2>
Explanation:</h2>
The above code has been written in Java and it contains comments explaining every line of the code. Please go through the comments.
The actual lines of code have been written in bold-face to differentiate them from comments.