Overloading

Java Made Clear: Difference Static binding Dynamic binding

Difference Static binding Dynamic binding Java, being an OOPs language, supports both static binding and dynamic binding. Coming to our topic, a class may have overloaded and overridden methods. When to call which method is decided (binded) sometimes by compiler and sometimes by JVM at runtime. Why this disparity? Why Java is designed like this? …

Java Made Clear: Difference Static binding Dynamic binding Read More »

Method overloading vs Method Overriding Java

Method overloading and method overriding are two concepts supported by a OOPs language. Method overloading Definition: Using the same method number of times in the same class but with different parameters is known as method overloading. Advantages: The same method call gives different outputs when called different times. For example, getArea() method may give sometimes …

Method overloading vs Method Overriding Java Read More »

Java Overload Main Method

Java Overload Main Method Summary: It is a frequent asked interview question. Your answer is YES and is explained in simple terms in this tutorial "Java Overload Main Method". Method overloading is nothing but using the same method in the same class a number of times with different parameters. Just like any other method, the …

Java Overload Main Method Read More »

Constructors and Constructor overloading

A constructor looks more like a method but without return type. Moreover, the name of the constructor and the class name should be the same. The advantage of constructors over methods is that they are called implicitly whenever an object is created. In case of methods, they must be called explicitly. To create an object, …

Constructors and Constructor overloading Read More »