1. Given:
What is the valid returnType for methodA in line 2?
2.
which method, placed at line 8, will cause a compiler error?
3. Which of the following will evaluate to true only if boolean expressions A, B, and C are all false?
4. Which of the following program fragments will produce this
output? (Ignore spacing.)
2 - - - - -
- 4 - - - -
- - 6 - - -
- - - 8 - -
- - - - 10 -
- - - - - 12
I
II
III
5. In the following code segment, you may assume that a, b, and
n are all type int.
6. Which statement about parameters is false?
7. In the following code, the constructors in the Rational
class allow initialization of Rational objects in several different ways. Which of the following will cause an
error?
public class Rational
8. int index=1;
int foo[]=new int[3];
int bar=foo[index];
int baz=bar+index;
what is the result?
9. If you have the following classes. Which of the following
constructors would be valid for Point3D?
I.
II.
III.
10. Assume that Base b = new Derived(); appears in a client
program. What is the result of the call b.methodOne();?