public class Stu{
interface A {
void onTouch();
}
public A setTouch() {
return new A() {
@Override
public void onTouch() {
}
};
}
public static void main(String[] args) {
Stu stu = new Stu();
stu.setTouch();
}
}
javac generated after compilation
can be seen to generate a total of three class files. Port A generates a class file, generates a file Stu $ 1.class inner class