Java Reference
In-Depth Information
΢΢ Exercise R8.7. On which classes does the class Integer in the standard
library depend?
΢΢ Exercise R8.8. On which classes does the class Rectangle in the
standard library depend?
΢ Exercise R8.9. Classify the methods of the class Scanner that are used in
this topic as accessors and mutators.
΢ Exercise R8.10. Classify the methods of the class Rectangle as
accessors and mutators.
376
377
΢ Exercise R8.11. Which of the following classes are immutable?
a. Rectangle
b. String
c. Random
΢ Exercise R8.12. Which of the following classes are immutable?
a. PrintStream
b. Date
c. Integer
΢΢ Exercise R8.13. What side effect, if any, do the following three methods
have:
public class Coin
{
public void print()
{
System.out.println(name + " " + value);
}
public void print(PrintStream stream)
{
stream. println(name + " " + value);
}
public String toString()
Search WWH ::




Custom Search