`

why can inner class be instantiated in this way?

 
阅读更多
public class Outer {

    public void instantiated() {
        Inner in = new Inner();
    }

    class Inner {
        public void a() {

        }
    }
}

 

class Inner can be instantiated in instance method, cuz before new Inner() is called, there must be an outer class instance existing, and if the method instantiated is static, it's not assured.

分享到:
评论

相关推荐

    Google C++ Style Guide(Google C++编程规范)高清PDF

    More complex inline functions may also be put in a .h file for the convenience of the implementer and callers, though if this makes the .h file too unwieldy you can instead put that code in a ...

    C# Game Programming Cookbook for Unity 3D - 2014

    1. Making Games the Modular Way 1 1.1 Important Programming Concepts.....................................2 1.1.1 Manager and Controller Scripts...............................2 1.1.2 Script ...

    sip-4.15.5.zip

    This applies both to the development of new components so that they can be reused in the future in a different context, and to the reuse of existing components that were developed independently of ...

    sip-4.15.5.tar.gz

    This applies both to the development of new components so that they can be reused in the future in a different context, and to the reuse of existing components that were developed independently of ...

    软件需求分析英文课件

    because a class can be instantiated into an object object class object would sound a bit strange) Instance object an instance of a class object, instance, but not object instance Class object ...

    abstract_class:Ruby 中的抽象类

    抽象类 Ruby 中的抽象类。 像模块一样,抽象类不能被实例化。 与模块不同,抽象类可以被继承,并且它们的... new #=> AbstractClass::Error - abstract class ActiveRecord::Base can't be instantiated ActiveRec

    burpsuite_v1.01

    A single instance of BurpExtender will be instantiated and shared between all plugins. To make use of the interface, create a class called BurpExtender which implements one or more methods of the ...

    java面试宝典

    196、Can a database connection pool be instantiated in init method of servlet instead of server connection pool? What will be the problem? 46 综合部分 46 197、Class.forName的作用?为什么要用? 47 198、...

    千方百计笔试题大全

    196、Can a database connection pool be instantiated in init method of servlet instead of server connection pool? What will be the problem? 46 综合部分 46 197、Class.forName的作用?为什么要用? 47 198、...

    VST SDK 3.612

    VST 3 Plug-in library could export multiple Plug-ins and in this way replaces the shell concept of VST 2 (kPlugCategShell). 12. Support Remote control Representation VST 3 Plug-in can deliver a ...

    php.ini-development

    Please see the actual settings later in the document for more details as to why ; we recommend these changes in PHP's behavior. ; display_errors ; Default Value: On ; Development Value: On ; ...

    Planets Earth, Mars and the Moon

    - Ready-to-use prefabs that can be dynamically instantiated. - Highly customizable shaders with normals, night lights, specular, and inner atmosheric scattering effect. - Separated clouds and clouds ...

    微软内部资料-SQL性能优化3

    In a multigranular locking environment, there must be a way to effectively overcome this scenario. Intent lock is the answer to this problem. Intent Lock Intent Lock is the term used to mean placing ...

    在Windows 2003 & 2008 & 2008 R2下自编程序FlexlmAu08-x86.exe破解Rational Rose2003&2007

    Windows 2003 & 2008 & 2008 ...20:46:13 Error: IDE support for VC++ cannot be instantiated 20:46:13 Update end 20:46:13 --- 20:46:13 1 error(s), 0 warning(s) --------------------------------------- 资料:

    XmlSerializer 常见问题疑难解答(MSDN)

    XmlSerializer 在程序中通过单个 API 调用来执行 XML 文档和对象之间的转换。转换的映射规则在 .NET 类中通过元数据属性来表示。这一编程模型带有自己的错误类别,开发人员需要了解如何诊断这些错误。...

    inventor学徒服务器Apprentice.pptx

    Apprentice can be very efficient for certain tasks in comparison of connecting to Inventor out-of-process. inventor学徒服务器Apprentice全文共12页,当前为第4页。 Apprentice Functionalities Provides ...

    easeljs1.0.0源码

    =b&&(-1==this._prevPos&&(this._prevPos=0/0),this._prevPosition=b,this._updateTimeline())},b._reset=function(){this._prevPos=-1,this.currentFrame=0},b._updateTimeline=function(){var b=this.timeline,c=...

    inventor学徒服务器.pptx

    Apprentice can be very efficient for certain tasks in comparison of connecting to Inventor out-of-process. 第3页/共11页 inventor学徒服务器全文共11页,当前为第3页。 Apprentice Functionalities Provides...

    tweenjs.min.js文件

    * This notice shall be included in all copies or substantial portions of the Software. */ this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}...

    NETCFSERUP

    This class is abstract and as such may never be instantiated as is.</remarks> - <summary>Default API constructor.</summary> - (System.Boolean)"> <summary>Abstract method that provides the ...

Global site tag (gtag.js) - Google Analytics