Looking back, I have been in the Java field for almost 15 years. Although my knowledge is average, sharing my experience may help everyone avoid detours.
[Getting Started]
I was in the C/C++ camp before 2001, with a foundation in C and object-oriented. Later I switched to Java and found that Java without pointers is really simple. In addition, Java The class library is so easy to use that it makes people cry.
Later I read "Thinking in Java" and "Java Core Technology", and I didn't feel that it was difficult.
#If I had never learned another language before, or if I became a monk and switched to the computer industry, I would not read the two books above first. Instead, I would choose " "Head First Java", this book is very suitable for novices with zero basic knowledge. It is easy and funny to read. If you don't believe me, just look at the first page
, but just reading the book is quite boring. , you might as well watch it in conjunction with the video. I think the basic Java video of Chuanzhi Podcast is very good (oh, I put an advertisement for Chuanzhi). You can find it by searching online. If you can’t find it, just come to my QQ group ( Group number: 159610322)
Note: The advantage of the video is that you can see the process of typing the code. The code is alive, which is very cool. If the video only talks about programming based on PPT, throw it away decisively.
Books also have the benefits of books. What can be written into a book must be something that the author can form after systematic thinking and sorting out, so it is relatively strong in systematicity.
The book also has other advantages, such as you can flip through it casually and find the key points to read again and again.
So a mixture of reading classic books + excellent videos should be the best way to get started.
Getting started with Java, I won’t go to training classes, which is a waste of money, self-study is enough.
During the self-study process, if I had an expert with rich practical experience to guide me, draw a route map for me, point out the direction of climbing, where there are traps, and where I should not waste time, my self-study could be reduced. Explore and avoid detours,
Unfortunately, I didn't meet him back then. If I could go back in time, I would try to find someone to guide me.
[Practice]
One of the characteristics of the software industry is that you will never learn by just watching and doing it. If you have less than 100,000 lines of coding, you will be embarrassed to go out and say hello.
So practice, practice, practice!
While in school, I will still try my best to find projects to do (see my other article "Enrich your resume from now on", reply to "resume" to view), but I really can't find it. You can lay a good foundation first
When I was in college, I used Yan Weimin's "Data Structure". I also did all the exercises at that time. When I took the senior programmer exam, my score was very good.
Later I learned about a better introductory book on algorithms, "Algorithm". If I could go back in time, I would still use Java to implement all the data structures and algorithms mentioned in this book. I also try to do all the final homework.
This is a very important training, because I know that if I really do it, I will find that as long as I am not designing algorithms, basic data structures will not be able to stump me.
##【Java SE】For the Java collection framework, not only must you learn to use it, but I will also try to implement it, List, ArrayList, Set, HashSet , Map, HashSet, etc. If you don’t know how to write, just look at the source code of JDK. There are the best teachers there. After implementing it, you can better understand object-oriented design, the relationship between interfaces, abstract classes, and concrete classes, how to separate responsibilities, and you will learn the template methods in design patterns, Iterator, etc. It is worth mentioning that Iterator is very interesting. I still clearly remember the excitement when I implemented Iterator in the collection framework that year:-)I am implementing the Java collection framework When doing this, you can also learn generics by the way. If you don’t learn it, you won’t be able to implement it. In the Java world, everything is an object. Everyone knows about encapsulation, inheritance, and polymorphism, but just understanding these is just an introduction, and it is impossible to make a real object-oriented program. There is a classic book "Agile Software Development, Principles, Patterns, Practices", which explains in detail a salary payment case, which is the best example of object-oriented design so far I will implement it in Java to really experience OOD and understand how to assign the appropriate responsibilities to the appropriate classes, what is interface-oriented rather than implementation-oriented programming, and what is the priority to use composition instead of inheritance.For Java threads, the key point is to understand the concepts, because I know that in future work (unless engaged in system-level programming), the opportunity to write my own threads/thread pools is very rare, and they are all encapsulated by class libraries and frameworks. . So the key point is to understand. If you read a book, of course it is "Java Concurrent Programming in Practice", written by a lot of experts.
For Java IO, I think the architecture design is very elegant and typical of the academic school, but it is not very practical. To open and read a file, you have to use the decorator mode to wrap it. Come and pack, I’m so tired.
In the actual project, it is to read a property file and xml file. I still focus on understanding the concept and design.
But it would be good to write a simple xml parser yourself.
As for AWT and Swing, just take a look at it. I won’t go into it in depth. Java is a typical server-side language. There are very few client-side programs. Think about it, you use Swing/AWT. When a desktop program comes out, the customer has to install a JRE before it can run it. Isn't it a bit excessive? As far as I know, some bank applications are using Swing and AWT. Some people may say that Applet was once popular, but no one uses it now.
So I won't waste time on Swing and AWT.
Java Reflection does not seem to be as dazzling as collection frameworks, threads, OO, etc., but it is the basis of many frameworks (SSH) (reply to "Reflection" to view related articles), learn the basics first, and then Java EE has to use it.
If you want to really learn Java well, how is it possible if you don’t understand the Java virtual machine? You must read "In-depth Understanding of Java Virtual Machine". The goal after reading it is to write a simple Java decompiler.
[Be a qualified Java coder]
I remember in 2008, my IBM manager said that design pattern is a necessary skill, no We can’t ask for anyone who understands design patterns.
So design patterns are a must-learn. In fact, they are used a lot in Java. They are simply a living textbook on design patterns. Factory methods, singletons, template methods, decorators, and chain of responsibility are all reflected.
Of course I will read the relaxing "Head First Design" first. Eric Gamma, one of the authors of "Design Patterns", highly recommends it and it is definitely not to be missed.
A few years later, my IBM manager said that now everyone knows our default design pattern, and agile practice is a necessary skill!
So, I have to know JUnit, I have to know refactoring, and I have to know the most basic agile practices such as TDD and continuous integration, otherwise I will be looked down upon by others.
As an aspiring Java coder, I must follow Java coding standards when writing code, such as capitalizing the first letter of class names, lowercase registration, and lowercase method names...etc.
As a code freak, I can't stand dirty code. I will constantly polish my code until it looks like a handicraft.
Java's best practices How can you miss "effective java"? It is full of the best usage of java programming summarized by the authors of JDK.
However, the translation is really not very good. Many sentences have to be carefully considered to know what they mean, so I plan to record a series of videos to explain them, so stay tuned.
【Java EE】
After walking so far, we finally came to Java EE. Isn’t Java just for writing server-side web applications?
I will write a Web program by myself. You can consider transforming the classic salary payment case mentioned above into a Web version, using the most basic technology Servlet/jsp/jdbc.
Then study struts, write a simple mvc framework yourself, and use it in your own Web program. This is called eating your own dog food.
Then study Hibenete, write a simple OR mapping framework yourself, and eat your own dog food again.
Then read the classic book "J2EE development without EJB". Yes, it was written by Rod Johnson, the author of spring. It subverted everyone's understanding of heavyweight EJB and opened a new era.
With the foundation of this book, it is not difficult to write a simplified dependency injection by yourself. After writing it, you can use it in your own Web program and eat your own dog food for the last time.
#You will know when you do it. All of these rely on Java Reflection.
Going forward, you should find real projects to work on, or find internships. That is another topic, and we will talk about it later.
【Reading Code】
Read three hundred Tang poems by heart, and you can recite them even if you don’t know how to compose them
Imitation is the best way to learn! Take a closer look at how the experts write their codes, and by doing so, your own martial arts skills will also improve.
If I had a good master by my side, followed him and watched him program, how fast would I improve?
While learning Java SE and Java EE, I will read these source codes:
Java Collection source code in JDK: The ancestor’s stuff is absolutely classic
JUnit Source code: See how Eric Gamma and Kent beck create systems through patterns (reply to "JUnit" to view)
SpringSide: With Spring Framework as the core, a Pragmatic style JavaEE application reference example, which is the JavaEE world Mainstream technology selection, summary and demonstration of best practices.
Developed by Chinese people, highly recommended.
In addition, I will still study the famous Jive forum at the beginning of this century. Although it is very old and the source code is full of academics, it is simply the base camp of design patterns and they are all living examples of application
There is a proxy mode to implement permission control, which is still fresh in my memory.
In addition, if you have spare time and are interested, of course you can read the source code of Struts, Spring, and hibernate, and even participate in the development.
How to learn Java, this is my feeling for so many years, and it is just my family talk. Welcome to communicate with me.
Learning programming has never been an easy task. It is impossible to learn it by watching videos or reading books. It requires a lot of programming and practice. Although programming is extremely hard mental and physical work, the joy of creation contained in it is also unparalleled. I hope everyone can enjoy this process and enjoy it.
#Attention, students learning Java! ! !
If you encounter any problems during the learning process or want to obtain learning resources, you are welcome to join the Java learning exchange group: 159610322 Let’s learn Java together!
The above is the detailed content of Learn Java process. For more information, please follow other related articles on the PHP Chinese website!