Exception Handling

Throw keyword in Java

In this tutorial, we will learn about throw keyword in Java. The throw keyword in java is used to throw an exception explicitly. We can throw both kinds of checked and unchecked exceptions using this throw keyword. But we mainly use throw keyword to throw custom exceptions(also known as the user-defined exceptions). Check out the …

Throw keyword in Java Read More »

Throws keyword in Java

In this tutorial, we will learn throws keyword in Java. There are many time when compiler finds some suspicious code that might throw a checked exception and warn programmers to solve exceptions. If programmer will not handle this kind of exceptions then the compiler will throw an error while compiling unreported exception XXX must be …

Throws keyword in Java Read More »

Try Catch Block

In this tutorial, we will learn about Try Catch Block in Java. Using Try Catch block is the best way to handle exceptions in Java. We keep all the code that might throw an exception in the try block. The try block is followed by the catch and finally blocks. In this catch and finally …

Try Catch Block Read More »