title: Java OOPS Parking Lot example Design
body: <p>Help me in understanding the power of OOPS in this famous <a href="https://stackoverflow.com/questions/764933/amazon-interview-question-design-an-oo-parking-lot">Parking Lot</a> example.
  I read this post yesterday trying to figure out perfect lower level design.</p>
  
  <p>ParkingLot
  - ParkingLot has ParkingSpaces ( List of ParkingSpaces)
  - exit()
  - entrance()
  - Update()
  - int capacity</p>
  
  <p>ParkingSpace
   -long id
   -String type (2 wheeler, 4 wheeler etc)
   -Vehicle (has Vechicle Reference)</p>
  
  <p>Vehicle (interface- any kind of vehicle (two wheeler, four wheeler)
   - park() 
   - Unpark() 
    abstract methods
   - has reference of ParkingLot and ParkingSpace</p>
  
  <p>Car,Truck different kind of vehicles implements Vehicle.</p>
  
  <p>Is there anything am I missing here...is there any design pattern I need to follow here..
  How are we achieving polymorphism in this example.</p>