//匿名内部类的基本使用
public interface Text1 {
void eat();
}
public class Person {
public void eat(Text1 t) {
t.eat();
}
}
package mine_1;
public class demo1 {
public static void main(String[] args) {
//匿名内部类
Person person=new Person();
person.eat(new Text1() {
@Override
public void eat() {
System.out.println("man eat meet..");
}
});
}
}