Yearly Archives

Null Pointer Exception In Java

NullPointerException is a RuntimeException. In Java, a special null value can be assigned to an object reference. NullPointerException is...

Null Pointer Exception In Java

NullPointerException is a RuntimeException. In Java, a special null value can be assigned to an object reference. NullPointerException is...

Chained Exceptions in Java

Chained Exceptions allows to relate one exception with another exception, i.e one exception describes cause of another exception. For...

Chained Exceptions in Java

Chained Exceptions allows to relate one exception with another exception, i.e one exception describes cause of another exception. For...

Multicatch in Java

Prior to Java 7, we had to catch only one exception type in each catch block. So whenever we...

Multicatch in Java

Prior to Java 7, we had to catch only one exception type in each catch block. So whenever we...

Infinity or Exception in Java when divide by 0?

Consider the following code snippets: public class PrutordotAi { public static void main(String args) { double p = 1;...

Infinity or Exception in Java when divide by 0?

Consider the following code snippets: public class PrutordotAi { public static void main(String args) { double p = 1;...

User-defined Custom Exception in Java

Java provides us facility to create our own exceptions which are basically derived classes of Exception. For example MyException...

User-defined Custom Exception in Java

Java provides us facility to create our own exceptions which are basically derived classes of Exception. For example MyException...

throw and throws in Java

throw The throw keyword in Java is used to explicitly throw an exception from a method or any block...

throw and throws in Java

throw The throw keyword in Java is used to explicitly throw an exception from a method or any block...

Checked vs Unchecked Exceptions in Java

In Java, there are two types of exceptions: 1) Checked: are the exceptions that are checked at compile time....

Checked vs Unchecked Exceptions in Java

In Java, there are two types of exceptions: 1) Checked: are the exceptions that are checked at compile time....

Catching base and derived classes as exceptions

Exception Handling – catching base and derived classes as exceptions: If both base and derived classes are caught as...

Catching base and derived classes as exceptions

Exception Handling – catching base and derived classes as exceptions: If both base and derived classes are caught as...

Types of Exception in Java with Examples

Java defines several types of exceptions that relate to its various class libraries. Java also allows users to define...

Types of Exception in Java with Examples

Java defines several types of exceptions that relate to its various class libraries. Java also allows users to define...

Flow control in try catch finally in Java

In this article, we’ll explore all the possible combinations of try-catch-finally which may happen whenever an exception is raised...

Flow control in try catch finally in Java

In this article, we’ll explore all the possible combinations of try-catch-finally which may happen whenever an exception is raised...