Posts tagged "throws keyword "

Tag Archives: throws keyword

throws Keyword in Java

In java, throws the keyword is used to declare an exception. We know there are two types of exception checked and unchecked Exception. Checked exceptions(compile time) are those which force the programmer to handle it, without handle these exceptions the program doesn’t compile successfully. While unchecked exception(Runtime) doesn’t get checked during compilation.   “throws keyword” is mainly used for handling … Continue reading throws Keyword in Java

Difference in throw and throws in Java

Let’s see What is Difference in throw and throws in Java. throw keyword and throws keyword both are related to Exception Handling in Java. The main difference between throw and throws is in their usage and functionality. where throws is used in method signature to declare Exception possibly thrown by any method, the throw is actually used to … Continue reading Difference in throw and throws in Java