Assignment 6
Assignment 6
Batch-5
Excercise 6:
Write a java program for arithmetic operation using abstract class ? Atleast three method
should used abstract method and other method concrete method.
*/
import java.util.Scanner;
abstract class Sum
{
public abstract int sum1(int n1,int n2);
public abstract int sub(int n1, int n2);
public abstract int mul(int n1, int n2);
}
}
/* Output:
D:\Java_eve\Day9>javac Demo123.java
D:\Java_eve\Day9>java Demo123
Enter x value :
10
Enter y value :
2
Method of class sum
12
8
20
5
*/