方法1:isInitializer() /** An environment is an "initializer" if it is a constructor or * an instance initializer. */ static boolean isInitializer(Env<AttrContext> env) { Symbol owner = env.info.scope.owner; return owner.isConstructor() || ow…
首先来看一下ClassFile,类注释如下: A JVM class file. Generic Java classfiles have one additional attribute for classes, methods and fields: "Signature" (u4 attr-length, u2 signature-index) A signature gives the full Java type of a method or field. When used…
interface IA{ public void md(); } public class Test07 implements IA{ final double d = 2.0d; final float f = 2.0f; final int i = 10000; final byte b = 10; String s = "mazhi"; public void md(){ IA ia = new Test07(); ia.md(); } } 最后经过Gen处理后变为: inte…