`

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 ...

    软件需求分析英文课件

    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 ...

    java英文笔试

    **Answer**: In Java, an abstract class can have both abstract and non-abstract (concrete) methods, whereas an interface can only have abstract methods (since Java 8, interfaces can also have default ...

    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 ...

    abstract_class:Ruby 中的抽象类

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

    SCWCD-model1.pdf

    ` - This option is incorrect because interfaces cannot be instantiated directly. **Correct Answer**: BD #### Knowledge Point 2: Overriding toString Method The second question tests the ...

    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、...

    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 ...

    CSharp 3.0 With the .NET Framework 3.5 Unleashed(english)

    - **Labels**: Labels allow you to mark specific points in your code that can be referenced by control flow statements like `goto`. - **Operator Precedence and Associativity**: This topic covers how ...

    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 ...

    Programmatic Differences Between Silverlight and WPF

    User controls can be instantiated multiple times within an application, promoting code reuse and simplifying maintenance. **Video** Both WPF and Silverlight support video playback, enabling ...

    一个win32下的ARM开源编译器

    Code written in UAL syntax can generally be assembled without modification in both ARM and THUMB modes. It is recommended to use UAL syntax for all new code. UAL syntax is get-what-you-write, whereas ...

    在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 常见问题疑难解答】 XmlSerializer 是 .NET 框架中的核心组件,主要用于XML数据和.NET对象之间的转换。它提供了一种高效、便捷的方式,通过API调用来实现XML文档与对象实例之间的序列化和反序列化...

Global site tag (gtag.js) - Google Analytics