成员会被编译到 subclass 的 .class 文件中吗?

Will members be compiled into subclass's .class file?

在java中,继承的成员(静态或实例、方法或字段)会被编译到子class的.class文件中吗?

或者只给超级class的相关成员保留一个link?

就class 文件而言,继承的成员不会复制到子class 中。这里是relevant documentation from Oracle(强调):

  • fields[] Each value in the fields table must be a field_info (§4.5) structure giving a complete description of a field in this class or interface. The fields table includes only those fields that are declared by this class or interface. It does not include items representing fields that are inherited from superclasses or superinterfaces.

  • methods[] Each value in the methods table must be a method_info (§4.6) structure giving a complete description of a method in this class or interface. [...] The method_info structures represent all methods declared by this class or interface type, including instance methods, class methods, instance initialization methods (§2.9), and any class or interface initialization method (§2.9). The methods table does not include items representing methods that are inherited from superclasses or superinterfaces.