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
4.4k 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
5.4k 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
5.7k points