I have recommended Java language reading books for you before. The following is to introduce you to the aspects from which to start learning Java language. The specific content is as follows
1. Java language basics
When it comes to books about basic Java language learning, everyone will definitely recommend Bruce Eckel's "Thinking in Java". It is a very profound technical book written, and basically no other book can surpass it in the basics of Java language. The author of the book, Bruce Eckel, is known as a genius speculator on the Internet. The author's "Thinking in C++" won the Software Development Jolt Award for Best Book in 1995. "Thinking in Java" was named "Favorite Readers Welcome Book" by Java World in 1999 and won the editor's preferred book award. Since 1986, the author has published more than 150 computer technology articles, published 6 books (4 of which are about C++), and has given hundreds of speeches around the world. He is the author of Thinking in Java, Thinking in C++, C++ Inside & Out, Using C++ and Thinking in Patterns, and is also the editor of the Black Belt C++ collection. His book is called "the best Java reference book... absolutely shocking" by readers; "the smartest choice to buy Java reference book"; "the best programming guide I've ever seen". The author's extraordinary talent and extremely transcendent language ability make the author selected as one of the 10 characters with the closest relationship with Java in the past 10 years of Java development.
"Thinking in Java" tells all aspects of the Java language, and many Java language veterans commented that "this is a book that speaks Java language quite ugly." The book talks about many details of the Java language, and each aspect is quite profound. Through this book you can see the "ugly" java language.
There are many videos on the Internet about Java language explanations, among which the Uncommon is garbage. "Weng Kai-JAVA Language" may be your only choice for learning the Java language basics. The lecture is basically explained in the book "Thinking in Java", which includes many interesting jokes from Teacher Weng. I was lucky to learn from this video. The content includes 30 lectures, and I watched it 3 times in total.
However, for beginners, I don’t recommend using Thinking in Java. I recommend Prentice Hall PTR’s “Core Java 2” in China called “Java 2 Core Technology”, which is currently the seventh edition. Everyone can download the electronic version on the Internet. Oreilly's "Java in a nutshell" is also a good choice. After reading the above two books, you can watch Teacher Weng Kai’s video, and then study “Thinking in Java”.
2. Java data structure
There are very few books on Java data structures on the market. There are roughly APress's "Java Collections", Jones and Bartlett's "Data Structures in Java", "Object-oriented Data Structures Using Java", and "Data Structures and Algorithms in Java" published by Prentice Hall (Dec 19, 2005) and "Data Structures And Algorithms With Object-oriented Design Patterns In Java". Fortunately, my first English book was APress's "Java Collections" (this book may not have Chinese version at all in China, but can only download the English version). It is very good, and it is very regular and simple. It is a book that introduces the Java Collections API, including the most extensive examples of extending APIs. This is the only good book I recommend you to learn Java data structures. There seems to be a Chinese version of the other two books by Jones and Bartlett in China. If you want to read it, you can also read it.
After learning the API, you can take a look at the corresponding classes in the java.util package. However, only after learning the design pattern can you fully understand the entire Java Collections Framework. The Java Collections Framework uses many famous design patterns such as iterator mode, factory method mode, decorator mode, adapter mode, etc. By studying the source code of data structures in the java.util package, you can know the design of the infamous Properties class, and may basically have the ability to design simple data structures.
The so-called learning is endless. After Sun provides the Java Collections Framework after learning, you can study another Java Collections Framework of Apche, which is very interesting. Two Frameworks that complement each other.
Before you learn and study Java Collections, I would like to remind you that Java Collections mainly include the following three parts: Interface, Implementation and Algorithm.
1. The main interfaces are List, Set, Queue and Map. List , Se t and Queue are subinterfaces of the Collection interface.
2. Implementation mainly implements specific classes that implement these interfaces. Such as ArrayList, LinkedList, Stack and Vector implementing List interface; HashSet, TreeSet and LinkedHashSet implementing Set interface; PriorityQueue, SynchronousQueue, etc. implementing Queue interface; HashMap, TreeMap, Hashtable, Properties, WeakHashMap, etc. implementing Map interface.
3. The algorithm is mainly provided by the Arrays class and the Collections class. It is the core of the entire Java Collection Framework algorithm. Supports common operations such as sorting and searching of various types.
Java Collections contains two versions of data structures, mainly the original data structure that supports synchronization and the data structure that does not support synchronization later.
The Java Collection Framework supports sorting using Comparator and Comparable interfaces. Iterator and Enumeraton are provided both new and old versions, as well as how they are converted, etc.
The Obserable interface and Observer classes in the java.util package are the core of the examiner pattern.
...
3. Java IO
There are only two books on IO on the market, both of which are Elliotte Rusty Harold's works. The styles of the two books are basically the same. The recommended reading is the first edition of "Jvava I/O". It is brief, the content is relatively concentrated, and there are many examples. The second edition was published abroad in May this year. I am very fortunate to download the second edition on the Internet. It was very detailed and 726 pages of the big guy (I have been using it for two weeks). This time, I combined NIO and IO together, including the J2ME part. However, the serial and parallel communication parts seem to be insufficient support for the class library and cannot actually operate it myself.
Oreilly, along with the first version of "Jvava I/O", also has a "Jvava NIO", which is also very good.
After reading "Jvava I/O" and "Jvava NIO" in turn, you can study the source code in the java.io package. Before you study the source code, I will give you some tips:
Java's io packages mainly include:
1. Two streams: byte streams and character streams. These two streams do not have the so-called "who replaces who is better than who is better than who is. They complement each other, but the focus is different.
2. Two types of symmetry: 1. Symmetry of byte streams and character streams; 2. Symmetry of inputs and outputs.
3. A bridge: InputStreamReader and OutputStreamWriter that converts byte streams into character streams.
Among them, you must pay attention to:
1. PipedInputStream and PipedOutputStrem are two more interesting classes.
2. Flows that support Buffered are classes that we often use.
3. The most famous application of the decorator pattern in Java is the design of io. Carefully study the relationship between each Filter stream and specific streams, and read more books on design patterns. I believe you will get something.
4. Learning good io packages is the basis for studying net packages, rmi packages...!
4. Java Database
There are too many books in the database, and it is also too bad! I have basically studied this kind of books. If you recommend it, you can check out Apress's "JDBC Recipes A Problem Solution Approach" which is very good. It was published abroad at the end of 2005 (it seems that there is no Chinese version in China, but it is not necessarily worth reading when it is released in China. China often translates foreign books in a mess and unsightly way) But we are really lucky that there are electronic versions on the Internet. Worth a look. I recommend the first book "Java Database Bible" published by Wiley that I am satisfied with, which is very well-written! The "JDBC API Tutorial and Refernece" introduced by Sun's own company about the JDBC API is also good. My second JDBC book is the API I studied.
However, these books are currently some relatively superficial API applications. If you have the opportunity, I will bring you a book introducing the JDBC API and the internal details of JDBC implementation! I will work hard as soon as possible and hope to get everyone’s support!
By the way, I would like to give some tips to friends who study JDBC:
The learning and use of JDBC is mainly based on this set of APIs, and the use process is also extremely simple. The following is the general process of using JDBC:
1. Load the driver (Driver class) of a database, usually using Class.forName("driver class name");
2. Connect to the database
Connection con = DriverManager.getConnection(url,username,password);
3. Get session Statement stmt = con.createStatement();
4. Execute the operation Result rs = stmt.executeQuery("SQL query statement");
5. Processing results
while(rs.next()){
String col1 = rs.getString(1);
...
}
It's simple! What can be changed in the entire JDBC is generally:
1. The Statement, PreparedStatement and CallableStatement can be created from the Connection object.
2. You can create multiple types of ResultSets: support one-way movement and free movement; updateable and non-updated; support transactions of different levels...
3. Batch processing of data input.
4. Operations of columns with special types (Blob, Clob, Arrary, Ref, Struct) in the result set.
5. These special types of entry databases.
6. Operation of special result sets (CachedRowSet, JdbcRowSet, WebRowSet) in the javax.sql package.
7. The other one is a DataSource, which is also very simple! A managed object in J2EE
It's simple! I believe everyone will conquer JDBC soon.
5. Java Network Programming
Network programming is a mysterious and challenging direction. However, before talking about Java network programming, we first thank the developers of Sun, because their genius ideas and intelligent architecture make it extremely simple for Java programmers to learn Java network programming.
For Java network programming books, I recommend O'Reilly's "Java Network Programming". It has been the third edition, and the previous version must be available on the market! There is a third electronic version on the Internet, published abroad in 2004, 706 pages! It is very comprehensive and in-depth. If it is too in-depth, it may be because some things in Sun are not fully disclosed, so it is difficult to talk about. If you are interested, you can download and take a look! The second book is "Java distributed computing" published by O'Reilly in 1998. The basic part is written in more detail, and the subsequent examples are still worth studying.
Before you read these books, I would like to give you some tips:
Java network programming is actually relatively simple, and it is also very fast to get started. Java network programming mainly includes two parts: 1.Socket; 2.URL part. However, the second part is also completely based on the first part.
1.Socket includes client Socket and server ServerSocket. There are also DatagramSocket and DatagramPacket, which correspond to the UDP communication protocol. In short, Socket part is the basis for establishing other high-level protocols.
2. The URL class is a network resource locator, which is usually related to specific network protocols such as HTTP, FTP, Telnet... This class can connect resources on the network, and its openStream can read network resources in the form of a stream (InputStream) in the io package; through its OpenConnection method, a connection can be opened, and not only the read operation can be completed, but also the write operation can be completed.
Java's network programming generally includes the above two parts. Network programming is very close to IO and multi-threading parts. Before learning this part, you must have a thorough understanding of these two parts.
After learning the above section, you can study the source code related to this in the java.net package! It's too early to study all the source code. The entire net package includes: ContentHandlerFactory, URLStreamHandlerFactory, URLStreamHandler, URLClassLoader and other auxiliary classes. They form the framework of java.net network programming. By studying its source code, you can not only quickly understand the java.net package, but also lay the foundation for expanding the package in the future, and even apply this way of thinking to your own projects.
So far, you should only know 60% of the java.net package. There is also a part you can use decompiler software such as JDecompiler to open the rt.jar in the /jdkxxx/jre/lib directory in your JDK installation directory, use software such as WinRAR to open its sun.net package, and decompile all files. It is a detail of the URL class work. After studying the sun.net package, you will be very familiar with the entire network programming.
Everything seems to be well-versed in network programming. Actually, it’s not the case. It’s just the beginning. If you want to go deeper, please continue! Many excellent network programming libraries and even software on the Internet can "add skills" to us. For example, Apache's HttpCore and HTTPConnection are two libraries related to the HTTP protocol; JGroups is a must-read library for studying distributed communication and group communication; then we can study P2P software packages, such as Sun's JXTA, which may be the future standard for point-to-point communication on the Java platform! Then you can research and use the extremely mature P2P software Azureus! www.sourceforge.net can be downloaded!
A journey of a thousand miles begins with a single step! Just do it! (At present, I have only studied the net package, and the others will continue to go deeper in the near future. Sun has not disclosed other implementation details of net for some reason. When it allows its source code to be studied in text form and allows its unpublished implementation to be written into the book, I really hope to publish a book about Java network programming to attract readers!!)
6. Servlet and JSP
Servlet and JSP books are also everywhere! There are only two or three books worth recommending. I actually recommend Addison Wiley's "Servlets and JavaServer pages: The J2EE Technology Web Tier", another very thick book! Published abroad in 2003, 784 pages, it is explained in a relatively comprehensive way and has many examples, especially Chapter 8 Filter, which gives a few good examples. All the other books I've seen about Servlets and JSP are not so in-depth! (It may be that I haven't seen it). O'reilly's "Java Servlet Programming" and "Java Server Pages" are relatively easy to understand, you can read it!
Before you learn Servlet and Jsp, I still want to remind you:
In essence, Servlet is just a program that implements the Servlet interface and is deployed on the server side! It can be written like writing any other java application. It can operate databases, operate local files, and connect to local EJBs... The general process for writing Servlet programs is:
1. Inherit a HttpServlet class;
2. Overwrite its doGet and doPost methods;
3. The internal operation method parameters HttpServletRequest and HttpServletResponse are performed on the override method.
4. Use HttpServletRequest to read the request. Using HttpServletRequest, you can operate the protocol header of the Http protocol, get the operation method of the request, get the path of the request, get the string of the request, and information related to the requesting client. More importantly, you can get the two objects: Cookie and HttpSession.
5. Using cookies, you can operate the "sweetheart" object or write it to the HttpServletResponse.
6. You can use HttpServletResponse to output information to customers. Use HttpServletResponse to write various types of protocol headers, add cookies, redirect other URLs, and send the status code of the Http protocol to customers.
7. Use HttpSession to complete any function you want to implement within the session.
At the same time, Servlet also provides some event and event listeners (just simple observer mode). There are also simple stream usage and decorator mode usage of filters (Filters) and wrappers (ServletRequestWrapper, ServletResponseWrapper).
Learning Sevlets and JSPs must be deployed to the server, just remember the steps and parameters of the usual file deployment and how to use them in the program.
After fully understanding Servlet, it is relatively easy to learn jsp! Jsp is based entirely on Servlets, and it is just to cater to programmers who like to embed scripts in Html documents (such as web programming languages such as PHP)! It's quite easy to learn!
Everything seems so calm and easy to learn! There are complex mechanisms behind simple appearances. To thoroughly study Servlets and Jsp, you have to study the specific implementation of open source software such as Tomcat. It is nothing more than a server. After the client uses the web page to send a request to the server through the HTTP protocol, the server converts the HTTP request into the corresponding HttpServletRequest object and calls the Servlet you wrote. In your Servlet, you must have operated this HttpServletRequest, and at the same time, operated the HttpServletResponse. The server will use the HTTP protocol to send this HttpServletResponse to your browser according to the requirements of the HTTP protocol! After the Jsp web page on the server is requested by the client, Tomcat will use the compilation software to compile this jsp file using the template in the javax.servlet.jsp package, and after compilation it will be a Servlet! The future operations are exactly the same as those of Servlets!
Based on Servlets and Jsp, the so-called advanced technologies: JSTL, Struts... are nothing more than the use of some tags and MVC patterns.
Keep moving forward! Victory is ahead! !
7. Multi-threading
A direction that looks mysterious but is easy to get started and difficult to master!
I recommend two books that I feel very good about. First of all, I was the first book I could read in this area. "Java Thread Programming" published by Sams in 1998. It is well written and easy to understand. I often read notes from that time when I have time! You should know how to do it yourself! The second book "Java Threads" published three times by OReilly is the latest version in 2004. There seems to be a Chinese version in China. I recommend you to read the English version! The book talks about N directions related to multithreading, such as IO, Swing, Collection, etc.
Let me give you some tips! There are not many classes related to multithreading in the Java class library, mainly: Thread, ThreadGroup, ThreadLocal and InheritableThreadLocal and One Runnable interface; keyword synchronize and volatile; and wait, notify, notifyAll methods of Object objects!
1 Thread is a core class of multi-threading, providing a series of methods to create and operate multi-threading.
2 ThreadGroup is a tool class for managing Thread.
3 ThreadLocal and InheritableThreadLocal provide Thread a class that stores thread objects similar to safe functions!
4 Runnable needless to say!
5 synchronize is the core of synchronization methods and synchronization blocks! When multiple threads call this method, only one thread can use this method, and other methods block, thereby ensuring the integrity of the internal state of the object being operated. When a thread calls a method or block with synchronize, it will get the object lock of the object. After completing the operation in the block, the object lock will be released, so that other objects can continue to operate.
6 wait, notify, notifyAll provides an effective waiting/notify mechanism. Each object in Java language has a lounge. Any thread rests in the lounge of the object when the state of the object it operates is not satisfied and releases the object lock; when other threads operate the object, they wake up the threads in the lounge, and then check the conditions, and perform the corresponding operation when the conditions are met.
There are roughly so many basics in multi-threading! Is it simple! This should not be enough for a real programmer. You must have some knowledge of multi-threading. Please study the java.util.concurrent package! The work of Master Doug Lea was originally an open source consistent programming library, but was later incorporated into the Java class library by Sun. There is another version of this library on the author's website! Good stuff worth studying! Open source software such as Hibernation and OpenJMS have used this package!
8. Design Pattern
When it comes to design patterns, many people will recommend the GOF book. This book is a five-star recommended book on Amazon. However, for those who have not been learning Java for a long time, especially those who are beginners in Java, I do not recommend this book. The main reason is that the examples in this book are basically in C++, and many details are not explained clearly enough.
The first book I recommend to you is Dr. Yan Hong's "Java and Patterns". It is the first book about design patterns written by the Chinese. It is quite interesting and integrates many Chinese nation's cultures and concepts. There are many examples and pictures, and they are relatively simple! Very good introductory books and a big guy!
Secondly, I recommend three sets of "Pattern In Java" published by Wiley Publishing House. I just read the first one. It seems that the second one is not very good, and the third one is not good!
The third book is the Chinese translation version of "Java Multi-threaded Design Pattern" published by China Railway Publishing House in 2003. It explains the multi-threaded model very briefly, with a large number of legends, each chapter has exercises, and finally has an answer! I started with it when I studied multithreading mode!
The fourth book, the Head First series of "Head First Design Pattern" published this year, adheres to the advantages of the Head First series of books, with a large number of class diagrams, rich examples, and interesting annotations, which are worth buying!
Secondly, in the J2EE direction, you can study and read "Patterns of Enterprise Application Architecture" published by Addison Wesley in 2002. It has many works by big names, which talk about enterprise information integration! "J2EE PATTERNS SL500" provided by Sun is also very good! I recommend the 4 and a half-star "Holub on patterns" of Amazon, which is a master's work, and provides examples worth studying. However, readers who are not very familiar with the above four books, it is best not to read it! It may make you more tired!
I went through a very tortuous route to learn design patterns, and I read about 20 books. I read Dr. Yan Hong's "Java and Patterns" 4 times, and ruled out that I basically didn't understand the first time I read it! I remember that the teacher taught us the GOF book during my first year of college. As an elective course, I was with their master's and doctoral students in the computer department. In the last class, 40-50 people, no more than 3 people understood, and I didn't understand anything (I don't know anything about C++ language if the foundation is poor). With my personality of not losing, I thought my understanding of Java language was OK, so I borrowed "Java and Patterns", but I still basically didn't understand it. Fortunately, when I was in my third year of graduate school, I listened to a lecture on Java OOP language by Mr. Rao Ruonan of Shanghai Jiaotong University. After I understood the three design patterns, such as the combination book model, I became interested in other models and had a desire to conquer them! The first book I bought after work was "Java and Patterns". I spent 2 months studying this big guy with more than 1,000 pages in the first time. Later, I could finish it in about 15 days after the third time, and I took a lot of notebooks! From then on, it was out of control.
Choose the right book and focus on research. I believe I will get started soon!
Learning Java language 8 simple parts is just the beginning of our research on Java language! All of this is understood, at best, a java programmer, the road ahead is very long! We can continue to study the source code of database implementation, the source code of Servlet server, RMI, EJB, JNDI, aspect-oriented programming, reconstruction, ANT tools, Eclipse tools, Spring tools, JBoss, JOnAS, Apache Geronimo and other J2EE servers! After researching these you might be an excellent J2EE Architecture! You can continue to research analyzers, compilers, JNODE (operating system written by java)...
For more exciting book lists, please click on the programming essential book list
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.