QUESTIONS WITH 100% CORRECT
ANSWERS
1. Which of the following statements about the reference super is TRUE ?
-Select one:
a. It must be the last statement of the constructor
b. It must be the first statement of the constructor
c. It can only be used once in a program
d. It must be used every time a method from the superclass is called.T -
ANSWER b
2. Which of the following is NOT TRUE ?
-Select one:
a. An interface is a solution for multiple inheritance in java
b. An interface can extend another interface
c. A class which is implementing an interface must implement all the
methods of the interface
d. None of the above.
e. An interface can implement another interface - ANSWER e
3. Which of the following statements is TRUE ?
-Select one:
a. The keyword extends is used to specify that an interface inherits from
another interface.
, b. None of the above.
c. The keyword extends is used to specify that a class inherits from a
interface
d. The keyword implements is used to specify that a class inherits from
another class
e. The keyword implements is used to specify that an interface inherits
from another interface. - ANSWER a
4. Which of the following statements is TRUE?
-Select one:
a. In Java the extends clause is used to specify interface
b. A final class can be abstract
c. All the members of the
superclass are inherited by the subclass
d. The subclass of a non-abstract class can be declared abstract
e. A class in which all the members are declared private, cannot be
declared public - ANSWER d
5. To prevent any method from overriding, we declare the method as,
Select one:
, a. static
b. const
c. final
d. none of the above.
e. abstract - ANSWER c
6. Which statement is TRUE regarding an object?
-Select one:
a. An object is a reference to an attribute
b. An object is what classes instantiated are from
c. An object is not an instance of a class
d. An object is an instance of a class - ANSWER d
7. A process that involves recognizing and focusing on the important
characteristics of a situation or object is known as: - ANSWER Abstraction
8. Which of these combinations of switch expression types and case label value
types are legal within a switch statement ?
9. -Select one:
a. switch expression of type boolean and case label value of type
boolean.
b. switch expression of type float and case label value of type int
c. switch expression of type byte and case label value of type float
d. switch expression of type int and case label value of type char
e. switch expression of type char and case label value of type long -
ANSWER d
, 10.What is byte code in the context of Java?
Select one:
a. It is another name for a Java source file.
b. The type of code generated by a Java Virtual Machine.
c. The type of code generated by a Java compiler.
d. It is another name for comments written within a program.
e. It is the code written within the instance methods of a class. -
ANSWER c
11.The extends keyword creates a new
-Select one :
a. Object
b. Instance
c. Superclass
d. Subclass
e Baseclass - ANSWER d
12.If class Dog has a subclass Retriever, which of the following is TRUE?
Select one:
a. Because of single inheritance, Dog can have no other subclasses.
b. Because of single inheritance, Retriever can extend no other class
except Dog.
c. The relationship between these classes implies that Retriever "has-a"
Dog.
d. The relationship between these classes implies that Dog "is-a"
Retriever. - ANSWER b
Object oriented inheritance models the
-Select one: