vendredi 7 juin 2019

What is the meaning of highlighted code line w.r.t. OOP?

    enter code here

public class ParkingSpot {
    private Vehicle vehicle;
    private VehicleSize spotSize;
    private int row;
    private int spotNumber;
    private Level level;
}

public abstract class Vehicle {
    protected String licensePlate;
    protected int spotsNeeded;
    protected VehicleSize size;

}

What is the purpose of "private Vehicle vehicle" in ParkingSpot class? Why do we do this?

Aucun commentaire:

Enregistrer un commentaire