March 2002
Intermediate to advanced
496 pages
8h 51m
English
Consider the SolidRocket simulation class shown in Figure 7.2. This class's constructor requires four parameters that establish a rocket's thrust. (The figure shows only the burn rate parameter; the other parameters are the specific impulse, propellant density, and burn area of the rocket.) Suppose that you own the simulation package and have a habit of declaring instance variables with the protected modifier. This policy lets other classes in your package access a SolidRocket instance's fields without having to call get- methods. This is somewhat risky, as you have to understand, for example, that changing the burn rate in a simulation means that you have to recalculate a rocket's thrust.
Read now
Unlock full access