abstract class school{
abstract void fees();
}
It is of two types 1) Abstract class 2) Interface class
Inner anonymous class with Abstract class:
school.java
abstract class school{
abstract void fees();
}
student.java
class student{
public static void main(String args[]){
school s= new school(){
void fees(){
System.out.println("5000");
}
};
s.fees();
}
}
output:
5000
college.java
interface college{
void bus();
}
prashant.java
class prashant{
public static void main(String args[]){
college c=new college(){
public void bus(){
System.out.println("four tyre");
}
};
c.bus();
}
}
output:
Four tyre
Address
Plot number-56/1 Near Gurudwara LandMark : Opposite A.N.D college Govindpuri Metro station New Delhi Mobile number: 8826034620