(Java)polimorfisme / Polymorphism

Polymorphism is the ability of a variable of a type / class to be used as a reference / reference objects of different types, and can automatically dial a specific method for each type.

Polymorphism pl = new Polymorphism();
pl = new Polymorphism;

Example :

public class Turunan {

     * @param args the command line arguments
    public static void main(String[] args) {
        // TODO code application logic here
        Customer cs = new Customer();
        cs = new Customer();
        System.out.println("hasil :"+cs.getID());
        MemberCustomer ms = new MemberCustomer();
        System.out.println("Member :"+ms.getMember());

Reference :
Ebook Java Desktop Ifnu Bima


Published by


hello I am jarcode

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s