These are Java Classes that cannot be directly Instantiated.
- Can have Abstract Methods
- Cannot have Concrete Methods Commonly, you do not define any body for the abstract methods within the class.
Boilerplate
// Abstract class
abstract class Sunstar {
abstract void printInfo();
}
// Abstraction performed using extends
class Employee extends Sunstar {
void printInfo()
{
String name = "avinash";
int age = 21;
float salary = 222.2F;
System.out.println(name);
System.out.println(age);
System.out.println(salary);
}
}