Category Java

Constructor Overloading in Java | Example Program

Constructor overloading in Java with example

In Java, constructor overloading means to define multiple constructors but with different signatures. Constructor overloading is a technique of having more than one constructor in the same class with different parameter lists. In other words, defining two or more constructors…

Methods in Java: Types, Method Signature

Types of methods in Java

Methods in Java are the building blocks of a Java application. A method is a block of code used to write the logic of the application, which performs some specific tasks or operations. In simple words, a method is a…

Throwable in Java | Throwable Class, Example

Throwable class hierarchy in Java

We know all exceptions and errors in Java are represented by classes. All these classes are organized as subclasses in a hierarchy under a superclass called Throwable. Throwable in Java is a predefined class that is the superclass of all…

Chained Exceptions in Java

Java 2, version 1.4 added a new feature chained exceptions. This feature relates one exception with another exception. The second exception explains the cause of the first exception. Chained exception in Java is a technique to handle exceptions that occur…