Core JAVA Archive
throw keyword: The throw keyword is used to explicitly throw an exception. We can throw either checked or unchecked exception. The throw keyword is mainly used to throw custom exception. We will see custom exceptions …
The finally Keyword: The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred. Using a …
In Java we can have nested try and catch blocks. It means that, a try statement can be inside the block of another try. If an inner try statement does not have a matching catch …
So far we have seen how to use a single catch block, now we will see how to use more than one catch blocks in a single try block.In java when we handle the exceptions …
A method catches an exception using a combination of the try and catch keywords. A try/catch block is placed around the code that might generate an exception. Code within a try/catch block is referred to …
Exceptions in Java – What are Java Exceptions? A Java Exception is an abnormal condition that arises during the execution of a program and also called a run-time error. An exception in Java signals the …
Apart from methods and constructors, Initialization Blocks are the third place in a Java Program where operations can be performed. Initialization Blocks come in two flavors: Static Initialization Blocks: Runs first when the class is …