-
Notifications
You must be signed in to change notification settings - Fork 173
Open
Description
Can you help me in understanding the need of creating a new reference for hashmap slots named allSlots using the getter method? Considering we can use the class variable slots directly as this.slots.
lld-parking-lot/src/main/java/com/uditagarwal/model/ParkingLot.java
Lines 44 to 48 in 071f9a0
| final Map<Integer, Slot> allSlots = getSlots(); | |
| if (!allSlots.containsKey(slotNumber)) { | |
| allSlots.put(slotNumber, new Slot(slotNumber)); | |
| } | |
| return allSlots.get(slotNumber); |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels