继承、覆盖是你期望的执行结果吗
下面例子摘自《深入JAVA虚拟机第二版》第19章,P354
PS:本文不做结果解释,原因请参考作者的解释。只描述结果
package com.shuidexiongdi.thread;public class SuperTest {public static void main(String[] args) {new Sub().exampleMethod();}}class Super {private void interestingMethod() {System.out.println("Super's interestingMethod");}void exampleMethod() {interestingMethod();}}class Sub extends Super {void interestingMethod() {System.out.println("Sub's interestingMethod");}}class Sub extends Super {void interestingMethod() {System.out.println("Sub's interestingMethod");}void exampleMethod() {interestingMethod();}}