/*
abstraction
has two way in java
<1.>
abstract class,
<2.>
interface
*/
//abstract
class
abstract class Student
{
//abstract method
abstract int add(int x, int y);
//non-abstract method
int sub(int x, int y)
{
return x-y;
}
}
class Calc extends Student
{
//implementing all abstract method
int add(int x, int y)
{
return x+y;
}
public static void main(String args[])
{
//note: we can't make object of abstract class
Calc
obj = new Calc();
System.out.println(obj.add(10, 5));
System.out.println(obj.sub(10, 5));
}
}