Inheriting members

Report a typo

Here are two classes: Bicycle and MountainBike:

class Bicycle {
        
    protected int cadence;
    private int gear;
    private int speed;
    
    protected int getSpeed() {
        return speed;
    }
        
    public void speedUp(int increment) {
        speed += increment;
    }
}

class MountainBike extends Bicycle { }

Which members of Bicycle does MountainBike inherit?

Select one or more options from the list
___

Create a free account to access the full topic