1、
interface ClassName { public String getClassName(); } class Company implements ClassName { @Override public String getClassName() { return new Company().getClass().getName(); } } public class CompanyTest { public static void main(String[] args) { ClassName cn = new Company(); System.out.println(cn.getClassName()); } }
2、
时间: 2024-12-23 00:55:10