Object Oriented Programming - I (3140705) MCQs

MCQs of Object oriented thinking

Showing 11 to 20 out of 64 Questions
11.
All classes in Java are inherited from which class?
(a) java.lang.class
(b) java.class.inherited
(c) java.class.object
(d) java.lang.Object
Answer:

Option (d)

12.
Static members are not inherited to subclass.
(a) TRUE
(b) FALSE
Answer:

Option (b)

13.
Which of the following is used for implementing inheritance through class?
(a) inherited
(b) using
(c) extends
(d) implements
Answer:

Option (c)

14.
Does Java support multiple level inheritance?
(a) TRUE
(b) FALSE
Answer:

Option (a)

15.
You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
(a) public
(b) private
(c) protected
(d) transient
Answer:

Option (c)

16.
What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?
(a) public
(b) abstract
(c) protected
(d) default access
Answer:

Option (d)

17.
Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?
(a) final
(b) static
(c) private
(d) protected
Answer:

Option (c)

18.
Which of these keywords are used to define an abstract class?
(a) abst
(b) abstract
(c) Abstract
(d) abstract class
Answer:

Option (b)

19.
Which of these is not abstract?
(a) Thread
(b) AbstractList
(c) List
(d) None of the Mentioned
Answer:

Option (a)

20.
If a class inheriting an abstract class does not define all of its function then it will be known as?
(a) Abstract
(b) A simple class
(c) Static class
(d) None of the mentioned
Answer:

Option (a)

Showing 11 to 20 out of 64 Questions