标签:
package com.mufeng.thetenthchapter; class WithInner { public WithInner() { // TODO Auto-generated constructor stub System.out.println("WithInner constructor"); } @Override public String toString() { // TODO Auto-generated method stub return "WithInner"; } class Inner { public Inner() { // TODO Auto-generated constructor stub System.out.println("Inner constructor"); } @Override public String toString() { // TODO Auto-generated method stub return "Inner"; } } } public class InheritInner extends WithInner.Inner { public InheritInner(WithInner wi) { // TODO Auto-generated constructor stub wi.super(); System.out.println("InheritInner constructor"); } @Override public String toString() { // TODO Auto-generated method stub return "InheritInner"; } public static void main(String[] args) { WithInner wi = new WithInner(); InheritInner ii = new InheritInner(wi); System.out.println(ii); } }
WithInner constructor Inner constructor InheritInner constructor InheritInner
enclosingClassReference.super()
标签:
原文地址:http://blog.csdn.net/u013693649/article/details/52103790