20.6k views
0 votes
A throw(...) statement is an alternative way to return from a function or method that indicates some kind of failure occurred.

Select one:

a. TRUE

b. FALSE

User Simmons
by
5.4k points

1 Answer

1 vote

Answer:

a.True.

Step-by-step explanation:

A throw statement is used to throw an exception from inside the method.Whenever the throw statement is encountered by the compiler and after that when it is executed the execution of the currently executing method is stopped and it returns back to caller.

There is also a keyword Throws which is used to tell the compiler that the method may throw one or more exceptions.

Hence we conclude that the answer is True.

User Chasemc
by
4.9k points