Implement abstract class with Single Inheritance



Write a program in Java to implement abstract class with Single
Inheritance and one Abstract class and one fully implemented method of super
class.





Program:


abstract
class A


 {


     abstract void show();  


 }


class B
extends A


 {  


  void show()


    {


     System.out.println("Hello A");


     System.out.println("Hello B" );


    }


}





class
Sk19


 {


  public
static void main(String args[])


   {


    B objB=new B();


    objB.show();


  


    }


 }











Compile:


D:\>javac
Sk19.java


Run:


D:\>java
Sk19


Output:


Hello A


Hello B
















Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C