Search Results For: shops

High level Abstraction

Polymorphism in Java


“polymorphism” means ‘a state of having many shapes’ or ‘the capacity to take on different forms’.   In Java, Polymorphism is an ability to access objects of related classes through a single, uniform interface. Two types of polymorphism in Java,   Compile time polymorphism (static binding)   Run-time polymorphism (dynamic binding). Method overloading is an example

Method overloading vs method overriding

Overloading and Overriding In Java


Method Overloading : Methods  have business logic that manipulates data(instances variable).   Methods would have method name, input arguments, return type and method body.   Sometimes we require to write two methods which are logically same but differ by input argument list.   Let us take class “Calculator”. public int add(int a, int b){ return a+ b; } public