1) All dispatch in Java (that we spoke about in class) is dynamic
(a) true
(b) false
(c) none of the above
2) Based on our discussion of Allan Kay?s criteria for Object
Orientation, is it plausible that said the following: ?I invented the
term 'object-oriented' and I can tell you I did not have C++ in mind.?
a) true
b) false
3) In Java it?s possible to have heap dynamic objects.
a) true
b) false
4) Left recursion can be removed from the following grammar (using
only the technique we discussed in class.
E -> E F | a
F -> FG | G | b
G -> E | c
a) true
b) false
5) An abstract class in Java may contain implementation code for the
methods it defines
a) true
b) false
6) In Java all problems with casts are detected at compile time.
a) true
b) false
7) In the expression M[M[i]] = M[i], the sub-expression M[i] is a
a) lvalue
b) rvalue
c) both
d) neither
8) Consider the following C++ code fragment:
int q[10];
int* p = &q;
int k;
in the expression below, the sub-expression p is a
k = *p++;
a) lvalue
b) rvalue
c) both
d) neither
9) There is a Reflection mechanism in C++:
a) true
b) false
10) All classes have a superclass in C++
a) true
b) false
11) All classes have a superclass in Java
a) true
b) false
12) If two classes, say A and B, are in the same package, then the
methods for the class A can see all the methods and fields of class B
and vice versa.
a) true
b) false
13) In C++ private data members can NEVER be altered except through
the public member functions associated with the class
a) true
b) false
14) In Java private data members can NEVER be altered except through
the public member functions associated with the class
a) true
b) false |