Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

Q&A 105

Q&A


Q. The term initializationhas been used in several places. What does it
mean?
A. It means to give something an initial value and set it up. When you cre-
ate a variable and assign a starting value to it,you are initializing the
variable.

Q. If a loop never ends,how does the program stop running?
A. Usually in a program where a loop does not end,something else in the
program is set up to stop execution in some way. For example,a loop in
a game program could continue indefinitely while the player still has lives
left.

One bug that crops up often as you work on programs is an infinite loop,
a loop that never stops because of a programming mistake. If one of the
Java programs you run becomes stuck in an infinite loop,press the red
alert icon to the left of the Output pane.

Q. How can I buy stock in the Green Bay Packers?
A. Unless the publicly owned NFL team decides to hold another stock sale,
the only way to become a stockholder is to inherit shares in a will.
The Packers have sold stock in 1923,1935,1950,and 1997.
Approximately 112,000 people own 4.7 million shares in the team,despite
the fact that they have very limited rights associated with the stock.
Holders don’t earn a dividend and can’t profit from their shares. They
only can sell them back to the team and lose money in the deal. No indi-
vidual can own more than 200,000 shares.
They do receive exclusive team merchandise offers and can attend an annu-
al meeting to elect the seven-member board that manages the team.
In the 1923 stock sale that formed the franchise,1,000 fans bought
shares for $5 each. The 1997 sale raised $24 million for the Lambeau
Field renovation.
More information on the stock can be found on the Web at
http://www.packers.com/community/shareholders.html.

Workshop


The following questions test your knowledge of loops. In the spirit of the sub-
ject matter,repeat each of these until you get them right.

Free download pdf