Skip to content

Tag Archives: Java-Overloading

Before going into the actual topic, first, we need to know about method overloading and type promotions. What is Method Overloading? When a class consists… Read More
Overloaded methods are those which belong to the same class, having the same name but different arguments. The concept of method overloading came from polymorphism.… Read More
Here we will be discussing the varargs / variable arity method and how we can overload this type of method. So let us first understand… Read More
The differences between Method Overloading and Method Overriding in Java are: S.NO Method Overloading Method Overriding 1. Method overloading is a compile-time polymorphism. Method overriding… Read More
How to overload main method in java? Method Overloading can be defined as a feature in which a class can have more than one method… Read More
Predict the output of the program public class GFG {     private GFG(Object o) {         System.out.println("Object");     }     private GFG(double[] d) {         System.out.println("double array");     }     public static… Read More
Prerequisite – Overloading in Java1) What is the output of the following program?   Java public class Test {     public int getData() //getdata() 1     {         return… Read More
Let us go through the basic pre-requisites such as Method Overloading, Autoboxing, and Unboxing. So method overloading in java is based on the number and… Read More
Prerequisite – Constructor, Overloading in java In addition to overloading methods, we can also overload constructors in java. Overloaded constructor is called based upon the… Read More
Prerequisite – Varargs , Method Overloading Method Overloading in Varargs Overloading allows different methods to have same name, but different signatures where signature can differ… Read More
Method overloading in java is based on the number and type of the parameters passed as an argument to the methods. We can not define… Read More
Overloading allows different methods to have the same name, but different signatures where the signature can differ by the number of input parameters or type… Read More
In Java it is very common to overload methods. Below is an interesting Java program.  Java public class Test {     // Overloaded methods     public void… Read More
Consider the below Java program. // A Java program with overloaded main() import java.io.*;    public class Test {            // Normal main()     public static… Read More

Start Your Coding Journey Now!