This post originated from an RSS feed registered with Java Buzz
by Arpit Mandliya.
Original Post: Polymorphism in java with example
Feed Title: Java tutorial for beginners
Feed URL: http://feeds.feedburner.com/arpitmandliyasblog
Feed Description: A blog about java programming language and its frameworks
Polymorphism is one of core Object oriented programming concepts with Abstraction, encapsulation, and inheritance. Polymorphism means one name many forms. In Java, polymorphism can be achieved by method overloading and method overriding. There are two types of polymorphism in java. Compile time polymorphism. Run time polymorphism. Compile time Polymorphism: Compile time Polymorphism is nothing but method overloading in java. You can define various methods with same name but different method arguments. You can read more about method overloading. Let’s understand with the help of example: When you run above program, you will get below output: Integer: 20 Double 30.0 Integer