Thursday, July 3, 2008

SCJP: overriding, overloading methods questions

1. Anonymous inner classes cant have an explicit constructor.
True

2. The return type of a Constructor in java is “void”.
False

3. Java includes a special reference value called ____, which is used inside any method to refer to the current object.
this

4. The ____ operator creates a single instance of a named class and and returns a reference to the object.
new

  1. To call another constructor from a constructor (of the same class), the ___ keyword is used This

6. In java it is possible and often desirable to create more than one method with the same name, but different parameter lists. This is called method ___.
Overloading

  1. A static inner class doesn’t have any refrence to an enclosing instance. True

8. An interface in java can extend another interface.
True

  1. Constructors are inherited by subclasses. False

10. An overriding method can be defined in the same class as the method it overrides.
False

No comments: