
Exception, Abstraction
Authored by Arti Sonawane
Engineering
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of an abstract method?
To define static behavior
To hide all functionality
To provide a method without implementation
To override superclass method
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What type of exception is NullPointerException?
Checked
Unchecked
Compile-time
Custom
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to manually throw an exception?
throws
throw
exception
raise
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about interfaces in Java?
interfaces cannot have methods
interfaces can have constructors
interfaces can have static and default methods
Interface methods are private by default
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about abstract classes in Java?
An abstract class can be instantiated
An abstract class cannot have any method
An abstract class can have both abstract and non-abstract methods
All methods in an abstract class must be abstract
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is not true about static methods?
They can access only static variables directly
They can call non-static methods directly
They belong to the class, not objects
They can be called without creating an object
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can an abstract method be private?
Only if the class is final
Only in interfaces
yes
no
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?