Discussion
Which four can be thrown using the throw statement?
1.Error
2.Event
3.Object
4.Throwable
5.Exception
6.RuntimeException
Answer: C
The (1), (4), (5) and (6) are the only four that can be thrown.
An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.
The Throwable class is the superclass of all errors and exceptions in the Java language.
The class Exception and its subclasses are a form of Throwable that indicates conditions that a reasonable application might want to catch (checked exceptions)
RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development