Java Reference
In-Depth Information
3. three times two = 6
1 times three = 28
1 times 1 = 42
three times 1 = 2
1 times eight = 20
4. whom and who like it
it and him like whom
whom and him like him
stu and boo like who
her and him like who
5. touch your eye to your head
touch your head to your eye
touch your shoulders to your elbow
touch your eyes and ears to your eyes and ears
touch your toes to your Toes
touch your shoulders to your knees toes
6. say coke not pepsi or pop
say soda not soda or pepsi
say pepsi not koolaid or pop
say say not pepsi or pepsi
7. public static void printStrings(String s, int n) {
for (int i = 1; i <= n; i++) {
System.out.print(s + " ");
}
System.out.println();
}
8. System.out.println is an overloaded method.
9. The program changes the value of its tempc parameter, but this doesn't affect the
variable tempc in main . The (incorrect) output is:
Body temp in C is: 0.0
10. (a) 1.6
(b) 2
(c) 36.0
(d) 64.0
(e) 10.0
(f) 116.0
(g) 7
(h) 5
(i)
5
(j) 8.0
Search WWH ::




Custom Search