Monday, 31 October 2016

Polymorphism

Polymorphism means taking many forms, where ‘poly’ means many and ‘morph’ means forms. It is the ability to allows us to perform a single action in different ways. Polymorphism in Java is of two types: 

  • Compile time polymorphism( or Static Polymorphism)
  • Run time polymorphism (or Dynamic Polymorphism)
We can perform polymorphism in java by :
  1. Method overloading (Compile time polymorphism)
  2. Method overriding (Runtime polymorphism)


No of Occurrence in Array

package com.tutorial4u; import java.util.HashMap; /************************************************************  No of Occurrence in Array...