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-10-19 21:46:15