Find the error in each of the following code segments:
1. // Superclass
public class Vehicle
{
(Member declarations . . .)
}
// Subclass
public class Car expands Vehicle
2. // Superclass
private double cost;
(Other methods . . .)
public class Car extends Vehicle
public Car(double c)
cost = c;
3. // Superclass
public Vehicle(double c)
private int passengers;
public Car(int p)
passengers = c;
4. // Superclass
public abstract double getMilesPerGallon();
private int mpg;
public int getMilesPerGallon();
return mpg;
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here