That's it. You may ask, do these ten lectures cover the main aspects of Java? Of course not. I haven't mentioned some important contents, such as network programming. Our lecture is not a textbook and is not comprehensive. It is mainly to give you an advanced understanding of Java through some topics. I said at the beginning that the audience is people who have graduated from relevant majors and have a basic knowledge of Java programming for about a year. There are many choices to read introductory textbooks and language reference books. I am determined not to follow the old path. I want to show you the understanding of a self regarded Java preacher based on my own experience. My series of lectures, from Java language to Web framework exploration, to design patterns and algorithms, to text analysis and natural language understanding, have been developed according to this idea. I'm not sure what the ultimate fate of this personalized technical writing is, but this is my choice.
Is java just another language? Many people think so when they first contact. There are too many languages. In history, most languages are only the instruction set of computers and do not have the systematicness of a "language". As the problem becomes larger and more complex, the convenience, flexibility and limitations of different expressions will be revealed. However, Java is different. You can't simply imagine Java as a collection of functional features. You can really realize the power of Java when you consider "design" rather than simple coding. I think Java can be a member of the language family. Like any human language, Java provides us with a way to express ideas.
Java significantly reduces the complexity of programmers developing programs. In the long-term development, it has solved important complex tasks, such as multithreading, network programming, enterprise computing framework, and finally solved the tasks of cross platform programming, dynamic code and security. When we use java to solve the problems we face, we can all go from "struggling" to "standing up and applauding".
Java system, grand view, self-contained. From the platform system on the original equipment, we iterated continuously, participated in and led the tide of Internet, mobile computing, big data and cloud computing. The key lies in the founder Gosling, who has a long-term vision and a broad vision. They are determined to formulate the rules for cross platform systems, and finally become famous and decent for decades. In response to the ancient poem: if you want to be poor for thousands of miles, go to a higher level.
For decades, Java has been popular and always in the forefront. I think there are several points. First, the syntax of Java is pure. It is a language produced under the typical pure object-oriented idea. Because it is pure, it is simple and easy to accept. 2, Java is not only a language, but also an ecology. It has the support of a large number of personnel and good solutions in important aspects, such as network programming, enterprise background programming, big data processing and mobile application development. 3, The development system of Java is very complete, code maintainability, compile time inspection, more efficient operation efficiency, cross platform ability, rich IDE, testing and project management tools. Therefore, the comprehensive ability of Java language is the best.
The rolling Yangtze River flows to the East, and the waves wash away the heroes. In the history of Java, there are a series of brilliant stars embedded. Let's learn about these towering figures.
Born in Canada, he wrote a multiprocessor version of Unix operating system when he studied for a doctorate in computer science at Carnegie Mellon University. In 1991, while working at Sun, Gosling and a group of technicians created a project called Oak, which aims to develop a programming language running on virtual machines and allow programs to run on multiple platforms such as TV set-top boxes. Later, this work evolved into Java. With the popularity of the Internet, especially the web browser developed by Netscape, Java has become a popular development language all over the world. Therefore, it is called the father of Java.
However, in the commercial society, the father of Java is also full of weakness for the development of Java. When I left Oracle, I wrote, "what I said is all about detail and honesty, but revealing the truth will only bring more harm." "There are patent disputes everywhere. Lawyers' eyes are shining," he said Finally, James left Oracle and then Google. Went to a company of ocean exploration robots. Maybe you can see our God on an island, somewhere looking at the stars and the sea.
Born in 1954, he founded Sun Microsystems in 1982 with Vinod Khosla, Scott McNealy and Andy Bechtolsheim and served as chief scientist until he left in 2003. He is a respected software genius. He has left countless admirable legends in the history of software and hardware. This thin and tall man with messy flaxen hair is known as "Edison of the software industry". There was a post on MIT's BBS asking "Who do you think is the best coder, and why?" Although everyone in the reply post stated that the best coders listed were ranked in no order, most people still ranked Bill Joy first. Maybe we can verify the position of Bill Joy in the eyes of programmers from one side.
Born in 1961. Bachelor's degree in computer science from Columbia University and doctor's degree in computer science from Carnegie Mellon University. When Java just surfaced and was ready to fight, Joshua Bloch came to Sun and began the process of leading the Java community into "Canaan Meidi". Joshua's handprint is left in every important version of Java, and he is also the founder of Java collection framework. Some people say that if James Gosling is compared to the father of Java, Joshua is the mother of Java who nurtures Java into adults. His masterpiece Effective Java must be familiar to Java fans. The book won the Jolt award of 2002.
With glasses on the bridge of his nose, the beard of King William II of Germany and a modest and shy smile on his face, he serves the master of the Department of computer science at the State University of New York at Oswego. He played an important role in the two great changes in the history of Java indirectly or directly. Tiger launched in 2004. Tiger incorporates 15 JSRs(Java Specification Requests) syntax and standards, one of which is JSR-166. JSR-166 is from util.com written by Doug Concurrent package. Doug is a selfless person. He knows that sharing knowledge is different from sharing apple. Apple will share less and less, and his knowledge will not be reduced because he gives it to others. The sharing of knowledge can stir up different sparks. He is called "the person who has the greatest impact on Java."
Founder and famous author of Spring Framework. Rod received a computer degree from the University of Sydney and a doctorate in music. He is an expert on the JSR-154 (servlet 2.4) specification. He looks like a typical English gentleman. Although he was born in Australia, he now lives in London. The well-known story is Spring. EJB is one of the core technologies of J2EE and is known as the Pearl on the crown. Rod Johnson stood up and claimed that EJB is not needed at all, shaking the whole Java EE and changing the historical trend. Rod Johnson will lead a far-reaching trend. But this trend is not Spring and Hibernate, nor IoC and AOP, nor even "lightweight architecture", but the working mode of all practical and realistic "evidence-based architecture". He is skeptical about many standards. Of course, the most obvious is EJB. He claims that if no one has implement ed a technology and directly formulate standards, it is definitely dangerous. He is a man who has been overthrown for a time. Just like Zhao Zilong of Changbanpo, he blocked 100000 powerful teachers with one person's strength.
James Duncan Davidson
From 1997 to 2001, he worked in Sun company. He created Tomcat application server, which is the most widely used java web server. At the same time, he also created ant construction tool. Ant uses XML to describe the construction and dependencies of the project. At present, it is still the de facto standard for the construction of Java Web projects.
Craig R. McClanahan
Born in Aarhus, Denmark in 1960. Head of Java Server Faces(JSF) technical specification group, founder of Apache Struts framework, head of Java Studio Creator, and author of Struts in action. He is one of the expert groups of servlet 2.2, 2.3 and JSP 1.1, 1.2 specifications and the architect of Tomcat servlet container Catalina.
Founded JBoss in 2001, which is an open source Java application server. Later, the software was sold to red hat company, and then joined Red Hat Company to continue the development of JBoss until February 2007.
Bruce Eckel is a top computer technology writer. He has superhuman expression ability. He is a voting member of the C + + Standards Committee and holds a bachelor's degree in Applied Physics and a master's degree in computer engineering. Thinking in Java written by him has become the No. 1 Java textbook of Tianzi, which is popular all over the world. This book is rich in content - from the basic syntax of Java to the most advanced features. It is suitable for Java programmers at all levels. Bruce has contributed to the global expansion of Java.
Born and raised in Beijing, Gong Li received a bachelor's degree and a master's degree in computer science from Tsinghua University and a doctor's degree in computer science from the University of Cambridge, UK. In 1996, Dr. Gong Li joined sun as the chief security architect of Java and designed the Java platform security architecture widely used by millions of users today. In 2001, he returned to Beijing to establish China Sun Engineering Research Institute and served as president.
From the impact on Java, Gong Li is not on this list, but he is the person who makes the greatest contribution to Java among Chinese, so I am also listed here. After returning to China, he was called "the highest wisdom of Java in China."
His name Li Gong is the same as that of a female star (Gong Li). Once he went to Singapore, the airport thought that the superstar had arrived in Singapore, and the president of the airport greeted him personally, which was once spread within Sun company.
Learning programming and mastering grammar is just an introduction. The real improvement is to practice constantly and solve practical problems with optimized methods. So keep thinking, keep learning, keep practicing.
Senior masters have summarized many laws and put forward some suggestions that can be used in their own actual combat process. Below I list the programming suggestions in Effective Java:
Creating and Destroying Objects Create and destroy objects Item 1: Consider static factory methods instead of constructors. 1 Consider replacing constructors with static factory methods Item 2: Consider a builder when faced with many constructor parameters. 2 When the constructor encounters multiple parameters(builder)replace Item 3: Enforce the singleton property with a private constructor or an enum type . 3 Enforce singleton properties with private constructors or enumeration types Item 4: Enforce noninstantiability with a private constructor . 4 Enhance the ability of non instantiation through private constructors Item 5: Prefer dependency injection to hardwiring resources. 5 Dependency injection priority hard connect resources Item 6: Avoid creating unnecessary objects. 6 Avoid creating unnecessary objects Item 7: Eliminate obsolete object references. 7 Eliminate out of date object references Item 8: Avoid finalizers and cleaners. 8 Avoid using finalization methods and cleaners Item 9: Prefer try-with-resources to try-finally. 9 try-with-resources first try-finally Methods Common to All Objects . Methods common to all objects Item 10: Obey the general contract when overriding equals. 10 Overwrite equals Observe the general regulations at all times Item 11: Always override hashCode when you override equals. 11 Overwrite equals Time always overwrites hashCode Item 12: Always override toString. 12 Always override toString Item 13: Override clone judiciously. 13 Careful overwriting clone Item 14: Consider implementing Comparable. 14 Consider implementation Comparable Interface Classes and Interfaces. Classes and interfaces Item 15: Minimize the accessibility of classes and members. 15 Minimize class and member visibility Item 16: In public classes, use accessor methods, not public fields. 16 Use access methods in public classes instead of public domains Item 17: Minimize mutability . 17 Minimize variability Item 18: Favor composition over inheritance . 18 Combination is better than inheritance Item 19: Design and document for inheritance or else prohibit it. 19 Either design and provide documentation for inheritance or prohibit inheritance Item 20: Prefer interfaces to abstract classes . 20 Interfaces are better than abstract classes Item 21: Design interfaces for posterity. 21 Design interfaces for future generations Item 22: Use interfaces only to define types. 22 Interfaces are only used to define types Item 23: Prefer class hierarchies to tagged classes. 23 Class inheritance is better than label class Item 24: Favor static member classes over nonstatic. 24 Preference is given to static classes over non static ones Item 25: Limit source files to a single top-level class. 25 Restrict source files to a single top-level class Generics generic paradigm Item 26: Don't use raw types. 26 Do not use native types Item 27: Eliminate unchecked warnings. 27 Eliminate non inspected warnings Item 28: Prefer lists to arrays. 28 list Better than array Item 29: Favor generic types. 29 Give preference to generics Item 30: Favor generic methods. 30 Favor generic methods Item 31: Use bounded wildcards to increase API flexibility. 31 Use bounded wildcard promotion API Flexibility Item 32: Combine generics and varargs judiciously. 32 Carefully combine generics and mutable parameters @ Item 33: Consider typesafe heterogeneous containers. 33 Type safe heterogeneous containers are preferred Enums and Annotations. Enumeration and annotation Item 34: Use enums instead of int constants. 34 use enum replace int constant Item 35: Use instance fields instead of ordinals. 35 Replace ordinal number with instance field Item 36: Use EnumSet instead of bit fields. 36 use EnumSet Substitute bit field Item 37: Use EnumMap instead of ordinal indexing. 37 use EnumMap Replace ordinal index Item 38: Emulate extensible enums with interfaces . 38 Simulating extensible enumeration with interface Item 39: Prefer annotations to naming patterns. 39 Annotation is better than naming mode Item 40: Consistently use the Override annotation. 40 Unified use Override annotation Item 41: Use marker interfaces to define types. 41 Define type with tag interface Lambdas and Streams. Lambda Expressions and streams Item 42: Prefer lambdas to anonymous classes. 42 Lambda Expressions are better than anonymous classes Item 43: Prefer method references to lambdas. 43 Method reference is better than Lambda expression Item 44: Favor the use of standard functional interfaces. 44 Standard functional interfaces are preferred Item 45: Use streams judiciously. 45 Use flow carefully Item 46: Prefer side-effect-free functions in streams. 46 Functions without side effects are preferred in the flow Item 47: Prefer Collection to Stream as a return type. 47 Return type Collection Priority flow Item 48: Use caution when making streams parallel. 48 Be careful when creating parallel streams Methods. method Item 49: Check parameters for validity. 49 Check the validity of the parameters Item 50: Make defensive copies when needed. 50 Make protective copies when needed Item 51: Design method signatures carefully. 51 Careful design method signature Item 52: Use overloading judiciously. 52 Use overloading with caution Item 53: Use varargs judiciously. 53 Cautious variable parameters Item 54: Return empty collections or arrays, not nulls. 54 Returns an empty collection or array instead of null Item 55: Return optionals judiciously. 55 Cautious return Optionals Item 56: Write doc comments for all exposed API elements. 56 For all exported API Element to write document comments General Programming General programming Item 57: Minimize the scope of local variables. 57 Minimize local variable scope Item 58: Prefer for-each loops to traditional for loops. 58 for each Superior to tradition for loop Item 59: Know and use the libraries. 59 Understanding and using class libraries Item 60: Avoid float and double if exact answers are required. 60 If precise answers are needed, avoid using them float and double Item 61: Prefer primitive types to boxed primitives. 61 The basic type is better than the packing type Item 62: Avoid strings where other types are more appropriate. 62 If other types are more suitable, avoid using them String Item 63: Beware the performance of string concatenation. 63 look out String Connection performance Item 64: Refer to objects by their interfaces. 64 Reference objects through interfaces Item 65: Prefer interfaces to reflection. 65 Interface is better than reflection Item 66: Use native methods judiciously. 66 Use local methods with caution Item 67: Optimize judiciously. 67 Prudent optimization Item 68: Adhere to generally accepted naming conventions. 68 Follow universal naming conventions Exceptions abnormal Item 69: Use exceptions only for exceptional conditions. 69 Use exceptions only for exceptions Item 70: Use checked exceptions for recoverable conditions and runtime exceptions for programming errors. 70 Use checked exceptions for recoverable situations and run-time exceptions for programming errors Item 71: Avoid unnecessary use of checked exceptions. 71 Avoid unnecessary use of detected exceptions Item 72: Favor the use of standard exceptions. 72 Preferred standard exception Item 73: Throw exceptions appropriate to the abstraction. 73 Throw an exception corresponding to the abstract Item 74: Document all exceptions thrown by each method. 74 Each method throws an exception with a document Item 75: Include failure-capture information in detail messages. 75 Include the capture failure information in the details Item 76: Strive for failure atomicity. 76 Try to keep failure atomic Item 77: Don't ignore exceptions. 77 Don't ignore exceptions Concurrency Concurrent Item 78: Synchronize access to shared mutable data. 78 Synchronous access to shared variable data Item 79: Avoid excessive synchronization. 79 Avoid over synchronization Item 80: Prefer executors, tasks, and streams to threads. 80 executors，task，stream Better than thread Item 81: Prefer concurrency utilities to wait and notify. 81 Concurrency tools are better than wait and notify Item 82: Document thread safety. 82 Thread safety documentation Item 83: Use lazy initialization judiciously. 83 Use delay initialization with caution Item 84: Don't depend on the thread scheduler. 84 Do not rely on thread scheduler Serialization serialize Item 85: Prefer alternatives to Java serialization. 85 Consider other options Java serialize Item 86: Implement Serializable with great caution. 86 Prudent implementation Serializable Interface Item 87: Consider using a custom serialized form. 87 Consider using custom serialization forms Item 88: Write readObject methods defensively. 88 Protective writing readObject method Item 89: For instance control, prefer enum types to readResolve. 89 For instance control, enumeration is better than readResolve Item 90: Consider serialization proxies instead of serialized instances. 90 Consider replacing serialized instances with serialized proxies
"You can't learn." We were surprised when we heard that James Gosling also wanted to read books on Java programming, such as Effective Java. Many programmers will think Gosling should not have to read any books. In fact, he wants to read. It is beneficial to open a book. Different people have different ideas. If they have a wide range of knowledge, they will make continuous progress and eventually become a great thing.
The only way to learn how to make progress is to concentrate. There are many temptations in today's society, which makes it difficult for people to study a technology at ease. However, it is too convenient to obtain information, and a large amount of information makes people at a loss. However, it should be noted that "three thousand weak waters, take a ladle to drink". Life is limited. Only by quietly studying a knowledge can we achieve success. The Three Character Classic says that the way of teaching is to be expert. As long as we have high aspirations, we can not be afraid of wind and rain, people's words and drift with the tide. "There are great brave people in the world. When they die, they will not be surprised, and they will not be angry for no reason. Therefore, they have a great number of kidnappers, and their ambition is far away" (Su Shi's theory of liuhou)
With the direction of concentration, then from low to high, step by step along the steps, the problem is solved one by one, and the accumulation is not good, one and ten, ten and a hundred, a hundred and thousands, thousands and thousands. Looking back, we have seen the mountains and small mountains.
Everyone should be prepared. This is a long, hard and lonely journey. A complete process starts from the determination of loneliness and anger, the middle is a difficult journey, and ends in the experience of joy. Wang Guowei's "human CI Hua":
Those who have become great undertakings and universities in ancient and modern times must go through three realms: "last night, the west wind withered the green trees, went up the tall buildings alone and looked at the end of the world." This is also the first stage. "I don't regret that my clothes are getting wider and wider. I'm haggard for Iraq." This second boundary is also. "The crowd looked for him thousands of times. Suddenly looking back, the man was in the dim light." This third boundary is also.
The task is heavy and the road is long. A gentleman should strive for self-improvement.