Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the purpose of the 'throw' keyword?
Answer: The 'throw' keyword is used to explicitly throw an exception.

Example:

throw new CustomException("This is a custom exception");
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook