It's important that an object is left in a valid state after construction. If you leave some instance variables null after construction, then a method could call these instance variables without knowing they're null, which results in a NullPointerException.
It's important that an object is left in a valid state after construction. If you leave some instance variables null after construction, then a method could call these instance variables without knowing they're null, which results in a NullPointerException.
https://github.com/ghazalghorabi/TDA553-lab1/blob/f6df43632a9ae64de64547bebdc0acb4455e2fc4/src/CarShop.java#L15