`

nested classes

阅读更多
nested classes 分两类,static and non-static.后者又叫inner class. 前者叫static nested classes.
class OutClass{
static class StaticNestedClass{}
class InnerClass{}
}

nested classes可以声明private, protected, package private(default), public.但是一般的class确只能声明为public或者package private. 因为nested class是最为class member 看待的。An instance of an inner class can exist only within an instance of its enclosing class and has access to its enclosing class's members even if they are declared private.
分享到:
评论

相关推荐

    java-嵌套类(inner class)-来自oracle官网

    3.Non-static nested classes(Inner classes) 3.1.Non-Static Inner Class(Inner Class) 3.1.1.non-static memner class访问enclosing class(outer class)的成员 3.1.2.enclosing class(outer class)...

    图像匹配方法的综述的文章

    介绍了计算机视觉的图像匹配方法,综述了各种方法

    Java-Docs-3.zip_nested

    Java Notes For Dates And Nested Classes very imp for interview

    Java简单讲义及习题

    Topics include: Object-oriented programming, primitives, arrays, objects, inheritance, interfaces, polymorphism, hashing, data structures, collections, nested classes, floating point precision, ...

    linux编程技术详解.part1

    linux编程技术详解配套光盘,含有书中实例源代码

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

    Scoping Namespaces Nested Classes Nonmember, Static Member, and Global Functions Local Variables Static and Global Variables Classes Doing Work in Constructors Default Constructors Explicit ...

    Java for Programmers

    * Classes, Objects, Encapsulation, Inheritance, Polymorphism, Interfaces, Nested Classes * Integrated OOP Case Studies: Time, GradeBook, Employee * Industrial-Strength, 95-Page OOD/UML 2 ATM Case ...

    Scala for the Impatient 2nd (完整英文第二版 带书签)

    5.8 Nested Classes L1 66 Exercises 68 6 OBJECTS A1 71 6.1 Singletons 71 6.2 Companion Objects 72 6.3 Objects Extending a Class or Trait 73 6.4 The apply Method 73 6.5 Application Objects 74 6.6 ...

    Addison.Wesley.The.Java.Programming.Language.4th.Edition.Aug.2005.chm

    Chapter 5Nested Classes and Interfacesdescribes how classes and interfaces can be declared inside other classes and interfaces, and the benefits that provides. Finally, Chapter 6Enumeration ...

    delphi中的脚本控件paxscript3.0

    All pax-languages support such concepts of the modern programming as namespaces, nested classes, inheritance, static(shared) members, indexed properties, default parameters, delegates, exception ...

    Groovy in Action 2nd Edition-Manning(2016)

    enums, annotations, generics, the classic for loop, nested classes, varargs, static imports, and the ability to use Groovy closures where Java 8 expects lambda expressions. The Groovy project has ...

    Delphi 7以来的新语法特性

    类内部类型与嵌套类(Class Types and Nested Classes) 可以说现在的Class的域几乎相当于原来的整个unit,以前不能放里面的元素现在都可以放里面了,这个也没什么好多说的,试验一下就很容易明白了。 终方法(Final...

    Addison.Wesley.C++.by.Dissection.2002.pdf

    4.6.2 Nested Classes....... . 152 4.7 An Example: Flushing....... . 153 4.8 The this Pointer........ . 158 4.9 static Members......... 159 4.10 const Members......... . 161 4.10.1Mutable Members.........

    Thinking in Java 4th Edition

    What’s Inside Preface 1 Java SE5 and SE6 .................. 2 Java SE6 ..........................Reusing Classes 165 Composition syntax ........... 165 Inheritance syntax ............. 168 Initializing ...

    C++ 标准 ISO 14882-2011

    Contents Contents iii List of Tables xi List of Figures xv 1 General 1 1.1 Scope . . . . ....1.2 Normative references ....1.3 Terms and definitions ....1.4 Implementation compliance ....1.5 Structure of this ...

    整理后java开发全套达内学习笔记(含练习)

    nested [java] 嵌套的 ['nestid] '如:内部类(nested classes) Object [java] 对象 ['ɒbdʒekt] Overload [java] 方法的重载(不同参数列表的同名方法) [,әuvә'lәud] Override [java] 方法的覆盖(覆盖父类的...

    Google C++ International Standard.pdf

    Contents Contents ii List of Tables x List of Figures xiv 1 Scope 1 2 Normative references 2 3 Terms and definitions 3 4 General principles 7 4.1 Implementation compliance . ....4.2 Structure of this ...

    C# 类的声明详解

    // and nested classes go here. } 一个类应包括: 类名 成员 特征 一个类可包含下列成员的声明: 构造函数 析构函数 常量 字段 方法 属性 索引器 运算符 事件 委托 类 接口 结构 示例: 下面的...

    解决jar发布时的出现D:/export-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/static

    springboot获取根目录及资源路径及解决jar发布时的出现D:/export-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/static,采用该工具类可在发布成jar时访问到资源文件路径地址

    Jpaca 帮助文档 Jpcap API EN.CHM

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed ...

Global site tag (gtag.js) - Google Analytics