Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: How can you create a custom exception in Java?
Answer: To create a custom exception, you need to extend the 'Exception' class or one of its subclasses.

Example:

class CustomException extends Exception { /* constructor and additional code */ }
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook