February 2014
Beginner
1248 pages
62h 25m
English
The for statement (lines 16–23) executes its body 10 times, varying control variable year from 1 to 10 in increments of 1. This loop terminates when year becomes 11. (Variable year represents n in the problem statement.)
Classes provide methods that perform common tasks on objects. In fact, most methods must be called on a specific object. For example, to output text in Fig. 5.6, line 13 calls method printf on the System.out object. Some classes also provide methods that perform common tasks and do not require you to first create objects of those classes. These are called static methods. For example, Java does not include an exponentiation operator, so the designers of ...
Read now
Unlock full access