Question: 1)Write a code in Java that implements multiple catch clauses. 2) Which line no shows problem in the code below and why? 1. interface IVehicle
1)Write a code in Java that implements multiple catch clauses.
2)
Which line no shows problem in the code below and why?
1. interface IVehicle { 2. public double tuneUpCost(); 3. public boolean canCarry(int numPassengers); 4. }
5. 6. class Car implements IVehicle { 7. int mileage; 8. int year; 9. boolean builtBefore(int otherYear) { 10. return this.year < otherYear; 11. } 12. } 13. 14. class Demo{ 15. public static void main(String args[]){ 16. IVehicle oldCar = new Car(); 17. oldCar.tuneUpCost(); 18. oldCar.builtBefore(1990); 19. } 20. }
answer in google from within 15 minutes
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
