ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

Polymorphism

Polymorphism

The word ‘polymorphism’ literally means ‘the capacity to take on different forms’. When applied to object oriented programming language like Java, it describes a language’s ability to process objects of various types and classes through a single interface.

Example:

  1. public interface Small{}
  2. public class House{}
  3. public class Room extends House implements Small{}

Room class is considered to be polymorphic since this has multiple inheritance.

Virtual Methods

Every non-static method in JAVA is by default virtual method except final and private methods.JAVA does not use virtual keyword.In simple language any function that can be overriden via inheritance is virtual.

Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!