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
0 Comments