143k views
4 votes
)Which of following can be thrown using the throwstatement?

? Error

? Throwable

? Exception

? RuntimeException

? All of Given

? None of given

User Tjmcewan
by
6.9k points

2 Answers

4 votes

Answer:

The answer is B: throwable

Step-by-step explanation:

Throwable is the super class of all exceptions

User Nejcs
by
8.3k points
5 votes

Answer:

All of Given

Step-by-step explanation:

The throw keywords can be used to throw any Throwable object. The syntax is :

throw <Throwable instance>

Note that Error and Exception are subclasses of Throwable while RuntimeException is a subclass of Exception. So the hierarchy is as follows:

Throwable

-- Error

-- Exception

-- RuntimeException

And all of these are valid throwable entities. As a result "All of Given" is the most appropriate option for this question.

User Huy
by
9.1k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.