正在加载图片...
nner ClasstEest向部类实例分析 AvA 在 BankAccount的非静态方法中,我们可以使 用类名 InterestAdder而不需要加任何限制词, 因为编译器会自动为它加上this变量作为限定 词。因此可以在对象 BankAccount的方法中生 成新的 IInterestAdder对象: O InterestAdder adder=new InterestAdderO O这也就相当于: O This. Interestadder adder =this, new InterestAdderO JAVAInnerClasstEest内部类实例分析 在BankAccount的非静态方法中,我们可以使 用类名InterestAdder而不需要加任何限制词, 因为编译器会自动为它加上this变量作为限定 词。因此可以在对象BankAccount的方法中生 成新的InterestAdder对象: InterestAdder adder =new InterestAdder(); 这也就相当于: This.InterestAdder adder =this.new InterestAdder();
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有