这段程序会输出什么?

来自 反射
Java 25 LTS 入门 2分钟

这段程序会输出什么?

Java
interface Tagged {
    default String tag() { return "stock"; }
}

class Product implements Tagged {
    private int tax() { return 2; }
}

public class Main {
    public static void main(String[] args) throws Exception {
        var method = Product.class.getMethod("tag");
        System.out.println(method.getDeclaringClass().getSimpleName());
    }
}
在试验场中打开
报告错误