Answers to Self-Review Exercises (Sections C.1–C.13)
a) sequence, selection, repetition.
b) if
...else
.
c) sentinel, signal, flag or dummy.
d) strongly typed.
e) prefixed.
a) False. A set of statements contained within a pair of braces ({
and }
) is called a block.
b) False. A repetition statement specifies that an action is to be repeated while some condition remains true.
c) True.
d) True.
e) False. Instance variables of type boolean
are given the value false
by default.
a) z = x++ + y;
b)
if ( count > 10 ) System.out.println( "Count is greater than 10" );
c) total -= --x;
d)
q %= divisor;q = q % divisor;
a)
int sum;int x;
b) x =
1;
c) sum =
0;
d) sum += x;
or sum = sum + x;
e) System.out.printf( ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.