TIJ——Chapter Ten:Inner Classes】的更多相关文章

先提纲挈领地来个总结: 内部类(Inner Class)有四种: member inner class,即成员内部类.可以访问外部类所有方法与成员变量.生成成员内部类对象的方法:OuterClass.InnerClass inner = new OuterClass().new InnerClass(); static inner class,即静态内部类.只能访问外部类的静态方法与静态成员变量,生成静态内部类对象的方法:OuterClass.InnerClass inner = new Out…
Reusing Classes 有两种常用方式实现类的重用,组件(在新类中创建存在类的对象)和继承. Composition syntax Every non-primitive object has a toString() method, and it’s called in special situations when the compiler wants a String but it has an object. Inheritance syntax You’re always do…
Chapter eight: 当我们做一个项目的时候,一开始可能会信息满满,或者说是通过一些调查分析后觉得自己的团队能完全实现用户所提出的所有要求,但是,往往在很自信的时候,我们都会处处碰壁,因为组内矛盾或者是队友不给力,或知识不够,从而无法完成最初的美好,那么我们此时应该怎么办? Chapter nice: 在学校期间,我们知道,如果以后想发展的更好,当然,现在我们必须要学习更多的专业知识,这一点是毋容置疑的,但是,我想问一下,除了专业知识外,我们应该还要学习一些哪方面的知识来完善自己,为日后…
///:~容我对这个系列美其名曰"读书笔记",其实shi在练习英文哈:-) Introduction to Objects Object-oriented programming(OOP) is part of this movement toward using the computer as an expressive medium. This chapter will introduce you to the basic concepts of OOP, including an…
Java Provides a number of ways to hold objects: An array associates numerical indexes to objects. It holds objects of a known type so that you don't have to cast the result when you're looking up an object. It can be multidimensional, and it can hold…
If we spoke a different language, we would perceive a somewhat different world. Ludwig Wittgenstein(1889-1951) You manipulate objects with references Although you treat everything as an object, the identifier you manipulate is actually "reference&quo…
Chatper 3 Discovering Classes and Object Exercises: 1.What is a class? A class is a template for manufacturing objects. 2.How do you declare a class? By providing a header followed by a body.The header minimally consists of reserved word class follow…
Runtime type information(RTTI) allows you to discover and use type information while a program is running. All classes are loaded into the JVM dynamically, upon the first use of a class. This happens when the program makes the first reference to a st…
Exception guidelines Use exceptions to: Handle problems at the appropriate level.(Avoid catching exceptions unless you know what to do with them.) Fix the problem and call the method that caused the exception again. Patch things up and continue witho…
A class containing abstract methods is called an abstract class. If a class Contains one of more abstract methods, the class itself must be qualified(限定,修饰) as a abstract. If you inherit from an abstract class you want to make objects of the new type…