Sunday, April 06, 2025

LATEST UPDATES
>> What is the difference between continue and break statement?  >> What is a singleton class? Give a practical example of its usage.  >> What’s the purpose of Static methods and static variables?  >> What are the various access specifiers for Java classes?  >> What is the difference between an Inner Class and a Sub-Class?    

Friday, 18 November 2016

What is the difference between throw and throws ?

The throw keyword is used to explicitly raise a exception within the program.

The throws clause is used to indicate those exceptions that are not handled by a method.

Each method must explicitly specify which exceptions does not handle, so the callers of that method can guard against possible exceptions. 

Finally, multiple exceptions are separated by a comma.

No comments:

Post a Comment

Designed By Seo Blogger Templates