Write a java program to demonstrate the implementation of abstract class. - BSC IT PRACTICALS

Friday, February 9, 2018

Write a java program to demonstrate the implementation of abstract class.


import java.util.Scanner;
abstract class test
{
abstract void get();
}
class test1 extends test
{
void get()
{
int a,b;
Scanner ob=new Scanner(System.in);
System.out.print("Enter 1st Number: ");
a=ob.nextInt();
System.out.println("Enter 2st Number: ");
b=ob.nextInt();
System.out.println("Addition is: "+(a+b));
}
}
class prac4C
{
public static void main(String args[])
{
test1 obj=new test1();
obj.get();
}
}

1 comment:

  1. Hi Team, the Java Program on demonstrate the implementation of abstract class was short and simple and I implemented the code snipped and easy to work with it. Thank You!!! For getting Java Training in Chennai contact us...

    ReplyDelete