Thursday 22 January 2015

How to create abstract class in java

abstract class NewCars{
    String CarsName=null;
    public void display(String CN)
    {
        this.CarsName=CN;
        System.out.println("CarName :"+CarsName);
    }
   
}
public class AbstractionExample extends NewCars{

    public static void main(String Dx[])
    {
        AbstractionExample absEx=new AbstractionExample();
       
        absEx.display("New i30");
       
    }
}

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...