1. Which of the following is not a
public method or instance variable of
The only valid public method is String.length().
2. What keyword is used to specify a class
The static keyword indicates a variable is shared by all instances
of a class.
3. Which of the following are valid
a) / This is a comment
b) /* This is a comment */
c) (* This is a comment *)
d) // This is a comment
The two valid comment types are // and /* */. A third type /** */
indicates a javadoc comment.
4. Which of the following will not produce
a compile-time error?
a) public class MyString extends
b) class MyClass implements
c) class NetworkClient
Sorry. That was a trick question. String is marked final, so
it cannot be subclassed in a). Your must know your API very well to pass!