User defined exception

User defined exception

Professional Development

20 Qs

quiz-placeholder

Similar activities

Java Quiz on Module 1 & 2

Java Quiz on Module 1 & 2

Professional Development

21 Qs

FORMATIVE ASSESSMENT 2 OOPS

FORMATIVE ASSESSMENT 2 OOPS

Professional Development

15 Qs

Java Chapter 11 Review Questions

Java Chapter 11 Review Questions

Professional Development

24 Qs

WCF Training Test II

WCF Training Test II

Professional Development

25 Qs

Unit4_Servlets_Exam1

Unit4_Servlets_Exam1

Professional Development

24 Qs

Java Fundamentals

Java Fundamentals

Professional Development

20 Qs

Datatypes and Flowcontrol

Datatypes and Flowcontrol

Professional Development

15 Qs

JavaScript

JavaScript

Professional Development

21 Qs

User defined exception

User defined exception

Assessment

Quiz

Computers

Professional Development

Hard

Created by

ANIL KUMAR

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is a user-defined exception in Java?
An exception thrown by the JVM.
An exception thrown by the user.
An exception created by a programmer to handle specific scenarios.
An exception that only occurs in user input.

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Differentiate between predefined and user-defined exceptions.
Predefined exceptions are thrown by users.
Predefined exceptions are built-in, while user-defined exceptions are custom.
Predefined exceptions are for runtime errors, user-defined for compile errors.
There is no difference between them.

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What are the two types of exceptions in Java?
Checked and balanced exceptions.
Normal and irregular exceptions.
Checked and unchecked exceptions.
System and application exceptions.

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

How can you raise a user-defined exception in Java?
Use the "create" keyword.
Use the "throw" keyword followed by an instance of a predefined exception.
Create a new exception class, throw an instance using "throw".
Use the "raise" keyword.

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Is a user-defined exception checked or unchecked in Java?
Only checked.
Only unchecked.
Either checked or unchecked, depending on parent class.
None of the above.

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Explain the purpose of using custom exceptions in Java.
To replace predefined exceptions.
To confuse other programmers.
To enhance code clarity, manageability, and address specific errors.
To make code more complex.

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Can you manually raise an exception in Java?
No, exceptions are only raised by the JVM.
Yes, using the "raise" keyword.
Yes, using the "throw" keyword
Yes, using the "exception" keyword.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?