Thursday 22 January 2015

Simple example of Polymorphisam in java

interface a{
   
    String CompanyName=null;
    public void set();
    public void get();
}

class b{
   
    public static void display()
    {
        System.out.println("THIS IS CLASS B");
    }
}
public class PolymorphisomExample extends b implements a{

    public static void main(String Dx[]){
       
        PolymorphisomExample PlEx=new PolymorphisomExample();
        b b1=new b();
        b.display();
       
    }

    @Override
    public void set() {
        // TODO Auto-generated method stub
       
    }

    @Override
    public void get() {
        // TODO Auto-generated method stub
       
    }
}

No comments:

Post a Comment

How to change Background color by selecting color from Listview

activitymain.xml file::> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xm...