सीधे मुख्य सामग्री पर जाएं

#56 What is Polymorphism in Java | Java में polymorphism क्या होता है ?

package com.sudhirtheindian2.java123;

import javax.swing.*;

public class poly {
public static void main(String[] args) {

// What is polymorphism in java ?

// poly --->>> many
// morphism--->>>form
// poly+morphism = many form

// polymorphism is the greek word
// whose meaning is same object having different behaviour


// person --->>>
// customer
// friend
// students
// teacher

// void person(teacher)
// void person(students)
// void person(friend)
// void person(customer)

// there are two type to achieve the polymorphism


// 1 compile time polymorphism
// (static polymorphism, early binding)

// A polymorphism which is exists at the time of compilation
// is called compile time or early time or static polymorphism

// method overloading
// we can achieve compile time polymorphism through method overloading


// 2 run time polymorphism
// (dynamic polymorphism ,late binding)

// A polymorphism which exists at the time of execution
// of program is called runtime polymorphism
// method overriding
// we can achieve run time polymorphism through method overriding


}
}

टिप्पणियाँ

इस ब्लॉग से लोकप्रिय पोस्ट