Java object oriented programming quiz part 10 contains 10 single choice questions. The Java OOPs questions will help you understand the OOPs concepts of the Java language. At the end of the quiz, result will be displayed along with your score and OOPs quiz answers online.
There is no time limit to complete the quiz. Click Start Quiz button to start the Java object oriented programming quiz 10 online.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Result
0 out of 10 questions were answered correctly.
Time has elapsed
Your score is 0 out of 0, (0)
Average score
Your score
Category Score
OOPs0%
Review Answers
1
2
3
4
5
6
7
8
9
10
Answered
Review
Question 1 of 10
1. Question
A constructor cannot throw any exception. It must handle all the exception itself using try catch block.
Correct answer.
False is the correct choice. A constructor can throw exceptions just like the methods in Java.
Incorrect answer.
False is the correct choice. A constructor can throw exceptions just like the methods in Java.
Question 2 of 10
2. Question
All the methods declared in an interface are implicitly public.
Correct answer.
True is the correct choice. All the methods declared in an interface is by default public whether you use public in method declaration or not. Moreover, they are also implicitly abstract.
Incorrect answer.
True is the correct choice. All the methods declared in an interface is by default public whether you use public in method declaration or not. Moreover, they are also implicitly abstract.
Question 3 of 10
3. Question
All the interfaces implicitly extends the Object class.
Correct answer.
False is the correct choice. All the classes in Java are subclasses of the Object class, interfaces are not. Interface can only extend another interface, it cannot extend a class.
Incorrect answer.
False is the correct choice. All the classes in Java are subclasses of the Object class, interfaces are not. Interface can only extend another interface, it cannot extend a class.
Question 4 of 10
4. Question
A class constructor cannot be private.
Correct answer.
False is the correct choice. A constructor can be declared as private. However, in this case, the object of the class cannot be created from outside the class as private constructor will not be accessible.
Incorrect answer.
False is the correct choice. A constructor can be declared as private. However, in this case, the object of the class cannot be created from outside the class as private constructor will not be accessible.
Question 5 of 10
5. Question
Which class defines the wait and notify methods?
Correct answer.
Option 3 is the correct choice. The wait and notify methods are defined by the Object class.
Incorrect answer.
Option 3 is the correct choice. The wait and notify methods are defined by the Object class.
Question 6 of 10
6. Question
An interface cannot define an inner class.
Correct answer.
False is the correct choice. An interface can define an inner class in Java.
Incorrect answer.
False is the correct choice. An interface can define an inner class in Java.
Question 7 of 10
7. Question
A final method cannot be overloaded.
Correct answer.
False is the correct choice. A final method cannot be overridden in the subclass. However, it can be overloaded.
Incorrect answer.
False is the correct choice. A final method cannot be overridden in the subclass. However, it can be overloaded.
Question 8 of 10
8. Question
A final class can be abstract.
Correct answer.
False is the correct choice. A class can either be final or an abstract, not both.
Incorrect answer.
False is the correct choice. A class can either be final or an abstract, not both.
Question 9 of 10
9. Question
A subclass must implement all the abstract methods declared by its parent abstract class.
Correct answer.
False is the correct choice. A subclass must implement all the abstract methods of the parent abstract class or it can declare itself as an abstract.
Incorrect answer.
False is the correct choice. A subclass must implement all the abstract methods of the parent abstract class or it can declare itself as an abstract.
Question 10 of 10
10. Question
A variable declared by an interface can be changed by the class implementing it.
Correct answer.
False is the correct choice. All variables declared inside an interface are implicitly static and final. Its value cannot be changed by the class implementing it.
Incorrect answer.
False is the correct choice. All variables declared inside an interface are implicitly static and final. Its value cannot be changed by the class implementing it.