Solutions to other chapters:
  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26  
Java Methods Home Page Skylight Publishing



Java Methods A & AB:
Object-Oriented Programming and Data Structures

Answers and Solutions to Exercises

Chapter 2

1. (c)F
3. (b)F (a compiler is needed only for software development)
6.   T
9.   See JM\Ch02\Exercises\Solutions\PrintFace.java.
10.   BLACK,   BLUE,   CYAN,   DARK_GRAY,
GRAY,   GREEN,   LIGHT_GRAY,   MAGENTA,
ORANGE,   RED,   PINK,   WHITE,   YELLOW
11. (b)+ adds two numbers, but it concatenates strings and concatenates a number to a string.  If you remove the parentheses around n + n, then concatenation will be performed first, and instead of, say, 10 you will get 55.
14.   See JM\Ch02\Exercises\Solutions\HelloApplet2.java.

Copyright © 2006 by Skylight Publishing