Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is output? public abstract class Vehicle { public abstract void move ( int miles ) ; public void printInfo ( ) { System.out.print (
What is output?
public abstract class Vehicle
public abstract void moveint miles;
public void printInfo
System.out.printVehicle ;
public class Car extends Vehicle
private int distance;
public void moveint miles
distance distance miles;
public void printInfo
System.out.printCar ;
public static void mainString args
Vehicle myVehicle;
Car myCar;
myVehicle new Vehicle;
myCar new Car;
myVehicle.printInfo;
myCar.printInfo;
a
Vehicle
b
Vehicle Car
c
Error: Car is not abstract and does not override abstract method move
d
Error: Vehicle is abstract and cannot be instantiated
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started