Category Archives

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...

3 Different ways to print Exception messages in Java

In Java, there are three methods to print an exception information. All of them are present in Throwable class....

3 Different ways to print Exception messages in Java

In Java, there are three methods to print an exception information. All of them are present in Throwable class....

Understanding OutOfMemoryError Exception in Java

In Java, all objects are stored in the heap. They are allocated using new operator. The OutOfMemoryError Exception in...

Understanding OutOfMemoryError Exception in Java

In Java, all objects are stored in the heap. They are allocated using new operator. The OutOfMemoryError Exception in...

Exceptions in Java

What is an Exception? An exception is an unwanted or unexpected event, which occurs during the execution of a...

Exceptions in Java

What is an Exception? An exception is an unwanted or unexpected event, which occurs during the execution of a...

Constructor Overloading in Java

In addition to overloading methods, we can also overload constructors in java. Overloaded constructor is called based upon the...

Constructor Overloading in Java

In addition to overloading methods, we can also overload constructors in java. Overloaded constructor is called based upon the...

Singleton Class in Java

In object-oriented programming, a singleton class is a class that can have only one object (an instance of the...

Singleton Class in Java

In object-oriented programming, a singleton class is a class that can have only one object (an instance of the...

Private Constructors and Singleton Classes in Java

Let’s first analyze the following question: Can we have private constructors ? As you can easily guess, like any...

Private Constructors and Singleton Classes in Java

Let’s first analyze the following question: Can we have private constructors ? As you can easily guess, like any...