The important point here is that a Submarine object will access its weapons through its Weapons Array. It has no knowledge of the exact weapon objects contained in the array, nor does it know how many weapons are contained in the array. This is generic programming and an example of polymorphic behavior. Now, lets build a small fleet of vessels with different engineering plants and weapon systems and exercise their capabilities. There are also no Weapon or Plant objects - only objects of classes derived from Weapon or Plant.
Polymorphic programming is a tricky concept to master.
Once you understand how to implement polymorphic behavior in code, your object-oriented solutions will become both increasingly generic and robust. This is a tremendous aid to code reuse and maintenance. References Booch, Grady.