Write a program in java to demonstrate abstract class?

abstract class Abs

{

                public abstract void display();

                public void print()

                {

                                System.out.println("Hii");

                }

}

class Abstract extends Abs

{

                public void display()

                {

                                System.out.println("Hello");

                }

                public static void main(String arg[])

                {

                                Abs x=new Abstract();

                                x.display();

                                x.print();

                }

}

Abstract Class.PNG

, , , , , ,

Leave a Reply