Previous | Home | Next |
Inheritance
Answer: A super class is a class that is inherited whereas subclass is a class that does the inheriting.
Answer: extends
(a). True
(b). False
Answer: (b). False
Answer: When superclass is declared as private.
Answer: Object class
(a). True
(b). False
Answer: (a). True
(a). True
(b). False
Answer: (b). False
Answer: Deriving an object from an existing class. In the other words, Inheritance is the process of inheriting all the features from a class
Answer: Reusability of code and accessibility of variables and methods of the superclass by subclasses.
Q.10 Which method is used to call the constructors of the superclass from the subclass?
Answer: super(argument)
Answer: super.method-name(arguments)
Q.12 Which methods are used to destroy the objects created by the constructor methods?
Answer: finalize()
Answer: Abstract classes are those for which instances can’t be created.
Answer: It must provide all of the methods in the interface and identify the interface in its implements clause.
Answer: getClass(), notify(), notifyAll(), and wait()
(a). True
(b). False
Answer: (b). False
(a). True
(b). False
Answer: (a). True
(a). True
(b). False
Answer: (a). True
Answer: Cannot because, local variable cannot be declared as final variables.
Answer: An abstract class may not be declared as final.
Answer: A class does not inherit constructors from any of it's super classes.
Answer: Two methods may not have the same name and argument list but different return types.
Answer: Overridden methods must have the same name , argument list , and return type. The overriding method may not limit the access of the method it overridees.The overriding method may not throw any exceptions that may not be thrown by the overridden method.
Q.24 What modifiers may be used with an inner class that is a member of an outer class?
Answer: a (non-local) inner class may be declared as public, protected, private, static, final or abstract.
Answer: this() is used to invoke a constructor of the same class
Answer: super() is used to invoke a super class constructor
(a). It's a concrete class
(b). It's a superclass
(c). It's a type of abstract class
Answer: (c). It's a type of abstract class
(a). Non-abstract
(b). Implemented
(c). unimplemented
Answer: (c). unimplemented
Previous | Home | Next |