我只是个JAVA的初学者找了本英文书来看。这里主要是一些摘要,帮助自己记忆理解,放到BLOG里只是为了督促自己坚持下去。
对于觉得不相干的朋友表示道歉:)
如果大家有更好的学习方法,请赐教!非常感谢:)
Struggling with JAVA for a while now, still haven't got the big picture of concepts. Although stuffed with all the words, like polymorphism, inheritance, inner class, abstract, etc. I feel bogged down everytime I?try to use?them in my program. This makes me feel so frustrated. I heard people talk about TIJ, it is like a philosophy book in JAVA. Hopefully, I will get everything I need from it.
Chapter 1
1.1
All programming languages provide abbstractions.
?Assembly language is a small abstraction of the underlying machine.?Many so-called?"imperative" language(Fortran, BASIC, and C) were abstractions of assembly language. The primary abstraction of these languages require you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve.The programmer must establish the association between the "solution space" and the "problem space".
The altrenative to? modeling the machine is to model the problem you're trying to solve. Early languages such as LISP and APL chose particular views of the world. PROLOG casts all problems into chins of decisions. Each of these approaches is a good solution to the?particular class of problem they're designed to solve, but when you step outside that domain they become awkward.
The Object-Oriented approach provides the programmer tools to represent elements in the problem space, thus the approach is not constrained to any particular type of problem. We refer to the elements in the problem and their representations in the solution space as "objects".For those objects, which has no problem-space analogs, the porgram is allowed to adapt itself to the lingo of the problem by adding new types of objects. Thus, OOP allows us to describe the problem in terms of problem, rather than in terms of the computer where the solution will run.
Some designer advocate the combination of various approaches into multiparadigm programming language.
Alan Kay summarized five basic characteristics of SmallTalk, the first successful object-oriented language and one of the languages upon which Java is based.
1. Everything is an object.A class is an object, an integer is an object...everything is an object.
2. A program is a bunch of objects telling each other what to do by sending messages. No matter inherit or extend, or simply?instantiate another object/class, all the work is about the interraction of objects.
3.Each object has its own memory made up of other objects. "create a new object by making a package containing existing objects." To build a complex program while hiding it behind the simplicity of objects. Does this mean inheritence?Probably not.
4.Every object has a type.
5.All objects of a particular type can receive the same messages.
?