代码改变世界

随笔分类 -  Thinking in Java

TIJ——Chapter Fourteen:Type Information

2016-09-03 09:23 by 星星之火✨🔥, 210 阅读, 收藏, 编辑
摘要: Runtime type information(RTTI) allows you to discover and use type information while a program is running. All classes are loaded into the JVM dynamic 阅读全文

TIJ——Chapter Thirteen:Strings

2016-08-29 10:45 by 星星之火✨🔥, 142 阅读, 收藏, 编辑
摘要: String 对象是不可修改的,对于被String 重载的'+' 和'+=' 运算符来说,当你用它们来连接两个String 对象的时候,它在底层并不会对于每一次连接均生成一个String 对象,取而代之,在底层会有一个非线程安全的可修改的StringBuilder 对象被构造出来,并且调用其appe 阅读全文

TIJ——Chapter Twelve:Error Handling with Exception

2016-08-14 17:03 by 星星之火✨🔥, 225 阅读, 收藏, 编辑
摘要: Exception guidelines Use exceptions to: Handle problems at the appropriate level.(Avoid catching exceptions unless you know what to do with them.) Fix 阅读全文

TIJ——Chapter Eleven:Holding Your Objects

2016-07-31 17:37 by 星星之火✨🔥, 266 阅读, 收藏, 编辑
摘要: 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 h 阅读全文

TIJ——Chapter Ten:Inner Classes

2016-07-31 17:34 by 星星之火✨🔥, 159 阅读, 收藏, 编辑
摘要: 先提纲挈领地来个总结: 内部类(Inner Class)有四种: 个人认为,内部类最常见的应用场景是:在方法中返回匿名内部类对象。 Remember the advice: Prefer classes to interfaces. If your design demands an interfa 阅读全文

TIJ——Chapter Nine:Interfaces

2016-07-31 17:32 by 星星之火✨🔥, 200 阅读, 收藏, 编辑
摘要: 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( 阅读全文

TIJ——Chapter Eight:Polymorphism

2015-06-16 10:25 by 星星之火✨🔥, 428 阅读, 收藏, 编辑
摘要: The twist |_Method-call binding Connecting a method call to a method body is called binding. When binding is performed before the program is run(by th 阅读全文

TIJ——Chapter Seven:Reusing Classes

2015-06-11 19:36 by 星星之火✨🔥, 373 阅读, 收藏, 编辑
摘要: Reusing Classes 有两种常用方式实现类的重用,组件(在新类中创建存在类的对象)和继承。 Composition syntax Every non-primitive object has a toString() method, and it’s called in special s 阅读全文

TIJ——Chapter Six:Access Control

2015-06-11 09:10 by 星星之火✨🔥, 230 阅读, 收藏, 编辑
摘要: package:the library unit The levels of access control from "most access" to "least access" are public, protected, package access(which has no keyword) 阅读全文

TIJ——Chapter Five:Initialization & Cleanup

2015-06-10 19:55 by 星星之火✨🔥, 358 阅读, 收藏, 编辑
摘要: Method overloading |_Distinguishing overloaded methods If the methods hava the same name, how can Java know which method you mean? There's a simple ru 阅读全文

TIJ——Chapter Four:Controlling Execution

2014-12-14 23:40 by 星星之火✨🔥, 206 阅读, 收藏, 编辑
摘要: 同上一章,本章依然比较简单、基础,因此只是做一些总结性的笔记。 1、 不像C和C++那样(0是假,非零为真),Java不允许用一个数字作为boolean值。 2、 C中,为了给变量分配空间,所有变量的定义必须在代码块前面。而C++和Java中没有这个限制,它允许更加自然的代码 风格,而且使得代码更容 阅读全文

TIJ——Chapter Three:Operators

2014-12-11 20:45 by 星星之火✨🔥, 196 阅读, 收藏, 编辑
摘要: Operators 本章节比较简单,所以简单的做一些笔记: 几个要点: 1、When the compiler sees a String followed by a "+" followed by a non-String, it attempts to convert the non-Strin 阅读全文

TIJ——Chapter Two:Everything Is an Object

2014-12-08 21:33 by 星星之火✨🔥, 496 阅读, 收藏, 编辑
摘要: If we spoke a different language, we would perceive a somewhat different world. Ludwig Wittgenstein(1889-1951) You manipulate objects with references 阅读全文

TIJ——Chapter One:Introduction to Objects

2014-11-28 15:53 by 星星之火✨🔥, 999 阅读, 收藏, 编辑
摘要: ///:~容我对这个系列美其名曰"读书笔记",其实shi在练习英文哈:-) Introduction to Objects Object-oriented programming(OOP) is part of this movement toward using the computer as a 阅读全文