The most controversial in the history of a Java books, worthwhile in the end we read?

Click on the blue " programmer Huang oblique " concerned about my yo

Add a " star ", you read every day with a good book!

Text / Huang oblique

Please indicate the source

Whether you are a new Java or Java older drivers, I believe you have heard about a book called "Java programming ideas" books, this book in the Java community can be said to be famous, the Bible has been called Java, Java books in perennial Pa sales standings standings.

Then this book is really so magical it, to help a novice or junior Java programmer, and whether it can be as big as it's known today, we study together to look at this book and see it in the end there is no the outside world that's so magical, with such confusion, let us into the science.

Let's look at Baidu Encyclopedia introduction to this book

The book won wide acclaim from the programmer, even the most difficult concepts in Bruce Eckel text and small affinity and direct programming examples will resolve in the face of the invisible. From the basis of Java syntax to the most advanced features (depth of object-oriented concepts, multi-threading, automatic project build, unit testing and debugging, etc.), this book can guide you step by step easy to master.

The award obtained from the book and reader comments from around the world, it is easy to see that this is a classic. This book chapters 22, including the operator, control the flow of execution, access control, multiplexing type, polymorphic, interfaces, exception handling error, a string, a generic array, the container depth study, JavaI / O system, pieces For the type of content, and transmits graphical user interface and the like. These rich content, including Java language basic grammar and advanced features, suitable for all levels of Java programmers to read, but also the great institutions of higher learning teaching materials and reference books as well as object-oriented programming language Java language.

As can be seen, this book is very comprehensive, and the basic and advanced, as well as the contents of combat are integrated into the book, this advantage is large and comprehensive, but the drawback is a long-winded up is for the novice to He said very unfriendly.

Few believe Java beginners are able to read this book and understand, then, why this book is so classic, but then novice so unfriendly it, I think, this is also the author's personal experience of a relationship, the following we take a look at the author Daniel is the story behind it.

about the author

Bruce Eckel is president of MindView company, which provides software consulting and training to customers. He is the C ++ standards committee has one voting member, holds a Bachelor of Applied Physics and Computer Engineering. In addition to the book, he is the author of "C ++ programming ideas", and with the co-author of "Volume 2 C ++ programming ideas" (two books in English and Chinese versions have been photocopied version of Machinery Industry Press the introduction of publication) and other works. He has published more than 150 papers, often attend seminars and lectures around the world.

Bruce Eckel from 1984 to date, has published more than 150 articles computer technology, has published six books (of which four are about C ++), and in the world made hundreds of speeches. He is the "Thinking in Java", "Thinking in C ++", "C ++ Inside & Out" "Using C ++" and "" author, is also "Thinking in Patterns Black Belt C ++" anthology edit. .

Read the above authors introduce, summed up a technical Daniel, proficient in C ++ and Java, while big brother is academia, such a person, the level of knowledge and technical skills are ordinary people and not an order of magnitude so write books, even though they have sought to close to the people, but inevitably there will be a lot of content in this book is still obscure, and often also introduce some of the language features of C ++, which makes a lot of people do not C ++ novices and experienced a loss.

So, this book simply does not look suitable for beginners, but for experienced workers have a Java-based point of view.

Of course, you will be curious, what did the book in the end, I now see it is appropriate, behind the content, we will book chapters and dismantling some talk in order to allow you this book have some knowledge of the context.

This book is suitable for you?

For the crowd: Java is not recommended for novice looking for some work experience of Java programmers look

Preconditions: read other more basic Java books, or read the book would be more painful

Take you read "Java programming ideas"

This is my first N times reading this book, but I really have the courage to read it, because every time I would be frightened away some of the complex concepts and obscure language.

In order to help you tell the good book, I decided to read it straight up about it, this book is worthwhile in the end you read, please follow my steps to look at this book in the end what did the it.

Chapter One: Introduction to Object

See this catalog, I believe many people will be forced to look ignorant, we are familiar with object-oriented technology is not inheritance, encapsulation Cadogan state it, plus up to interfaces and abstract classes, why would so much content here yet.

Personally I think that this is the author's style, do not forget, Bruce Eckel from 1984 to date, has published more than 150 articles computer technology, so this book also has a lot of academic language color description, together with the translation of foreign the book comes with buff (usually more difficult to understand after translation) makes this book a lot of content are hard to understand.

Even now I re-read this book, you have to look at dancing, because many complex concepts I do not want to touch, I believe that this "head first Java" we still a little impression last time we talked about, that book is the concept is simple as speaking, reading experience better.

Especially for the novice, looking directly at this "Java programming ideas" is definitely asking for discouraging, and I do not believe that a few people have the patience to read the whole book.

Let's look at this summary, the author or the reader will have to bring some experience of Java programmers to look at, for example, he will assume that you are familiar with the process-oriented language, and would have the advantages of OOP in a very iffy, people watching after the address him "nb" but does not know what he is talking about.

Of course, the book is regarded as a classic nature has its reason, after all, this book is not to locate the original white to see if we have the experience from a Java programmer's perspective, it is not able to dig out more many treasures it, may wish to continue to look down together.

Chapter Two: Everything is an object

With the groundwork of the first chapter, I have to understand the author's style is certainly a more casual elegant, although the title of the second chapter is called "everything is an object," but in fact talking about something more integrated.

In addition to references to explain the object, the object of the concept of memory allocation, garbage collection and other objects, also talked about the structure of the namespace and packages in Java, and also referred to the comments and coding style, this chapter seems to want to tell you how to write What a Java program.

Of course, when the author explains each concept is very strict and particular about, such as memory allocation that part of the presentation objects, but to string together these elements, organized into the second chapter, is definitely not in line with our general reading habits

Obviously, such a chapter by chapter to the introduction to this book, remember running account a bit mean, so I think some of the less important chapter, we alluded to.

For example, Chapter 3: operator, Chapter 4: control the flow of execution, these two chapters talking about something you learned c language would not be strange, nothing more than arithmetic, bit operations, and if else, for loop, and so on, then Chapter 21 is a graphical interface that we skip introduction.

The remaining chapters, if nothing can be skipped up. Well, we'll introduce the relevant chapters in it together.

Initialization and cleanup, access control

Chapter V: initialization and cleanup, it is the class constructor, initialize way and garbage collection focuses on the initialization allow for object creation, while garbage collection is used to destroy the object.

Chapter 6: Access Control, mainly about Java package, between the relationship between the class and how to control classes, access conditions between packages, we all know that Java has four access keyword: public , default, protected and private, correspond to the four access rights.

Multiplexing type, polymorphic, the interface

This section describes the multiplexing class inheritance actual Java programming often have to face the problem portfolio, inheritance improve reusability, support for multi-state, while the combination can be decoupled, make the code more flexible. In many cases, inheritance and composition can be used together, and it is also very reasonable.

There is also referred to the concept of the agent, the agent is another compromise inheritance and composition is incorporated, in general, can be divided into static and dynamic proxy agent, and is mentioned in the book static agent.

Let's look at this section of the multi-state, multi-state fact-based inheritance to achieve, due to inheritance, the subclass can exhibit all the characteristics of the parent class, so the reference to the parent class can point to an object subclass, and execution All methods of the parent class.

The advantage is that you can receive all the subclass object referenced by the parent in a method where, for example, a method called eat (Fruit f) means that eating fruit, we can pass an object in addition to the Fruit also there are Apple, Peach and other objects, provided that they have inherited Fruit.

Fruit fruit = new Apple();

Application of a transformation that is upward.

When we want to turn into a sub-class references the parent class reference, we need to ensure that this object is indeed a part of this sub-category, such as this example

Apple apple = (Apple)fruit
这里使用的就是强制转型

Of course, we can not turn into Apple Peach.

Fruit fruit = new Apple();
Peach peach = (Peach)fruit
这样的话就会抛出类型转换异常啦

This example is actually polymorphic best explanation. Then look at the interface

It represents the relationship between inheritance is a, is a combination of the representative of the relationship has a rather abstract classes and interfaces is further completed abstract upgrade.

For example, there is an abstract class called Animal, animal animals collectively, which itself should not be instantiated, but its subclasses, Tun Town can be instantiated, but the abstract class itself can be some of the animals have a common method of implementation, such as will eat, will sickness and death.

This is best described as an example of an abstract class, while the interface is what the interface even more abstract than the abstract class, it may represent one feature, and this feature, such as "girlfriend" is a feature, then we can declare an interface called "girlfriend", have a girlfriend you can implement this interface, but this interface usually have some abstract methods, you have to achieve it, such as "date", "shopping", "pay "and many more.

The single dog does not need to implement it, because you do not deserve to implement this interface 2333.

Inner classes, holding the object

In fact, Java inner class has always been inside a very unique implementation, we usually use are not necessarily more, but that in itself is useful.

For example, we want to at any time during a class visit to a class, you can use inner classes, such as a graphics class called, can be a part of the internal computer class of this class, all properties and methods can access the computer graphics at this time, this design is very reasonable.

The inner class is also divided into a static inner classes and non-static inner classes (that is, ordinary inner class), static inner class and outside the class is actually unrelated, but the equivalent of the name listed on the outside of class only, such as a sheets of paper on the table, this piece of paper can be understood as a static inner class desks in this class, although both have nothing, but you want to access the class when you have to use the table. paper () in such a way get it.

The second part, on the content of holding the object, in fact, is primarily concerned with how to hold a collection of class objects, in fact, if memory allocation from the point of view, only the storage container object reference, not the object itself.

abnormal

In general, the error code should was found at compile time, but in fact, they might be discovered at runtime, this time we need to introduce an exception handling mechanism, and the Java exception handling mechanism allows you to exception handling and function code separately, using the syntax and try catch exception object, we can get rid of most of the Java exception, and it is very convenient to use.

String type information

String String is the biggest feature class is immutable, because it is declared as final type, once generated string objects on the heap, it does not change the change, of course, a reference string itself can be changed, it the string can point to other objects.

The main content of this chapter is to introduce a string of some commonly used methods and appropriate usage.

This part is actually talking about the run-time type information and reflection, run by the JVM to describe a class Class object and storage of information, the information can obtain it through this object, in general, we can get the classes and objects through reflection run-time information, such as methods, fields, we can also complete reflection object instantiation, method invocation, which helped us a lot done at runtime.

Generics, arrays, container-depth study

I did not expect this book to be so generic sections describe detailed, in general, is to discuss several issues discussed generic, one is the use of generics, we can use the generic methods and class declaration, then we need Learn erase mechanism generics.

In addition there are two common and generic mechanism is generic wildcards and boundary, we can? Generic to as a wildcard, and extends to the use of the defined boundaries.

I did not expect a small array can account for such a large space, this book really put a lot of details have to dig deep.

This section describes undertake the above content on collections, introduces a whole set of framework classes, and some implementation details and practical methods to do a little introduction, Java and leads in several specific references: soft references, weak reference and dummy reference.

Java IO system

JavaIO system is a very important part of Java content, but sometimes we do not use much, if we rarely file or operating network programming, the contact IO may not be too much, of course, to understand the back network programming, this part still must be mastered.

Enumerated types, annotations

A small enumeration actually have so much content, that is, in fact, we usually use it to replace only constants, such as Monday through Sunday, you can make an enumeration named WeekDayEnum.

In fact, part of the annotations should be reflected together better, because we usually have to use reflection to get notes, often more than annotation is to allow us to see, but can indeed play a role, how to play a role in it, that It is to use reflection to obtain the notes, then the appropriate treatment.

For example, I wrote a comment @Log on a class ( "controller") we can get all of this annotated classes through reflection, and then print controller logs related to the implementation of the method, in order to achieve unified logging function is implemented by printing notes.

Complicated by

Finally came to the last part of the concurrent, we usually know is actually concurrent multi-threading, thread pool, then that is JUC and contracting, as well as synchronization and locking mechanisms such as the contents of concurrency, including many in fact, are interested need to find a specialized a concurrent programming books to look at, such as "Java concurrency in combat."

My book review

Overall, the book is the pursuit of a comprehensive, professional and authoritative, try to turn each point with a precise knowledge of words to introduce, but might consider reading experience a little lacking for legibility and readers.

Most people do not have patience to read the book (me too) because of the length of the book is too long, and the higher the difficulty of reading, a kind of feeling in reading the papers, basically can not find any air or ground is interesting description, and next door "head first Java" in sharp contrast, as a strict and pedantic and interesting group of young people, are you, how would you choose it.

Maybe when you delve into complex knowledge of each point, the book can better help to you, provided you can accept the author's language style, if you want to learn relaxed and happy and entry Java, so there are more suitable for beginners books waiting for you to explore.

-----------------------

Public number: Programmer Huang oblique (ID: AntCoder )

Blog: www.how2playlife.com

Know almost: Huang ramp programmers

Station B: Huang ramp (seeking attention)

We committed to making it easier for more people to self-study program , Give a man a fish, but also giving the fishing

Focus on micro-channel public number [programmers] Huang oblique reply "2019" to receive learning materials finishing my two years

Covers self-programming, job interview, Java technology, algorithms, brush problems, such as basic computer and study section 8000G data collection.

Published 301 original articles · won praise 1686 · Views 1.24 million +

Guess you like

Origin blog.csdn.net/a724888/article/details/105002532