throw Java Keyword
"throw " is a keyword defined in the java
programming language. Keywords are basically reserved words which have
specific meaning relevant to a compiler in java programming language likewise
the throw keyword indicates the following :
-- The throw keyword in java programming language is used to throw an
exception.
call stack till it is caught by an appropriate catch block lying among the multiple catch blocks.
-- If any method throws an exception which is not a RuntimeException, then it must be declared in advance to handle the exceptions it throws using a throws modifier on the method declaration.
|
import java.io.IOException; public class Class1{ public method readtheFile(String file) throws IOException{ <statements> if
(error){ |


