Answer the question
In order to leave comments, you need to log in
How to associate a class with a qualifying class?
There is a Ship class (a ship)
There is a ShipType class (a type of ship with its characteristics - well, there is speed, maneuverability, etc.)
Do I need to store ShipType in my Ship, or is it better to do it through the shipTypeId field?
Do I need to store the id in the Ship itself?
Or, in principle, pass the ShipType object to the Ship constructor and from it write all the fields with ShipType into similar fields (speed / maneuverability, etc.)?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question