Write a java program :
Create an abstract class ‘Fares’ with an abstract method ‘fareCharged()’. $10, $15 and $20 are thefares charged by Bus, Auto and Cab respectively. ‘Bus’, ‘Auto’ and ‘Cab’ are subclasses of class‘Fares’, each having a method named ‘fareCharged()’ which prints the fare charged by differentvehicles. Call this method by creating an object of each of the three classes.Expected Output:Fare charged by Bus is $10Fare charged by Auto is $15Fare charged by Cab is $20
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here