Given:
class FuelNotAvailException extends Exception { }
class Vehicle {
void ride() throws FuelNotAvailException { //line n1
System.out.println("Happy Journey!");
}
}
class SolarVehicle extends Vehicle {
public void ride () throws Exception { //line n2
super ride ();
}
}
and the code fragment:
public static void main (String[] args) throws FuelNotAvailException, Exception {
Vehicle v = new SolarVehicle ();
v.ride();
}
Happy Journey!?
Which modification enables the code fragment to print
line n1 with public void ride() throws FuelNotAvailException {
rameasy
Highly Voted 3 years, 12 months agoasdfjhfgjuaDCV
Most Recent 4 months, 3 weeks agosteefaand
5 months, 3 weeks agoiSnover
5 months, 3 weeks agojohnchen88
4 years, 6 months agoadnano1234
4 years, 6 months agothetech
4 years, 8 months ago