How to quickly lay a good foundation for Java?

Author: Shen Shijun link: https: //www.zhihu.com/question/50904128/answer/521519858
Source: know almost

From university to now, I have been using Java for nearly 20 years. I also take interns every day and do internal training in the company, so I can share my experience and hope it will be useful to you.

Because it is training on the job, there must be two constraints: practicality and tight time. Therefore, it is impossible to cover all the knowledge points like a university. Instead, you can only pick the basic, practical, and difficult to understand. As for the knowledge of other corners and corners, I just passed them on. One has no time, the other is not used frequently, and even if it is spoken, the students are not impressed. In a word: "Good steel is used on the blade."

Below, I will talk about the learning process specifically based on my practice:

1. Basic knowledge

When I was learning Java, I first read through "Java Programming Thoughts" and then "Java Core Technology". At that time, these two books were not as thick as they are now, and just now I turned over the 9th edition of "Java Core Technology" on the desk. The upper and lower volumes have more than 1,700 pages. It is conceivable that if you want to read it through. , Not to mention adjusting all the codes, even when reading a novel, it may take some time.

But I still recommend "Java Core Technology" in my teaching now, mainly because of the complete system, many examples and strong operability. But for beginners, I usually only talk about the first 6 chapters, which is the following:

1. Overview
of Java programming; 2. Java programming environment;
3. Java basic programming structure;
4. Object and
5; Class and follow;
6. Socket and internal classes.

As far as the 9th edition of "Java Core Technology" is concerned, it is up to 250 pages. Work harder, and it will be no problem to win in one month.

Because you are self-study, it is recommended that you must adjust all the codes and do your homework as much as possible after class. In addition, there are two important points:

#. Study Notes

Because you are self-study, it is not like you can practice after learning in a company, so the impression is naturally very deep. Self-study is particularly important because there is no timely feedback on practice. Because taking notes is like writing, it's a great way to organize ideas. At the same time, study notes are also excellent materials for your future development and interview.

When learning programming, people are different from people. What others find difficult to understand is not necessarily to you; and what you find difficult to understand may be very simple to others. The study notes are their own "difficulty manual", which is a bit like the "wrong question book" during the college entrance examination. In the future, whether it is before the interview or in the daily work, you can turn it out at any time. shallow.

#. Save demos by category

The study notes are very good text materials, but there is a saying in the programming world that is particularly good. The so-called "no code, no text" means that there is no piece of code for a thousand words.

In my experience, in the process of learning, you will encounter various knowledge points, no matter how thorough you understand it at the time and how good you are at debugging, as long as the time is long, when it is practical, you will definitely encounter various The problem of some seemingly simple things, at this time, life and death are not reconciled, as the so-called people are confused. At this time, if you have a good demo, open it for reference (or even copy it directly), the problem will be solved naturally. And because these demos are debugged by you, the impression is naturally very deep. Whenever you encounter a problem, it will immediately pop up in your mind.

Therefore, in the process of learning, you must treat the demo you tuned well, and don't throw it away when you run out. When you encounter difficulties later, you can't find it when you want to use it. The correct way is to save all the demos that have been transferred into different categories, and it will be handy to find the source at that time. People say that "the book will hate less when you use it", but the same is true for the code, the so-called "demo will hate less when you use it".

2.Spring

At present, in the development of Java EE, Spring has become the same infrastructure as the Java core library, so if you want to become a qualified Java programmer, Spring is definitely inevitable. On the other hand, if you have mastered the Spring system, you will be able to carry out some practical development even if you get started with Java.

However, Spring itself is becoming more and more complex, with more and more derivative projects, but the core concepts are still IOC and AOP. Once you have mastered these two concepts, you can learn Spring MVC and learn other derivative projects.

At the same time, because Spring itself applies many elegant design concepts, the process of learning Spring is also a process of strengthening the basic knowledge of Java. So when you master Spring, many Java features that you don't understand thoroughly will suddenly come to your mind, including interfaces and abstract classes.

I studied Spring, and the first book I read was "Spring Practice". Frankly speaking, the book is very general, but I have not encountered a book that is better than it on the market. There is also a "In-Depth Analysis of Spring Source Code", which is particularly thorough about Spring's design concepts. Although the whole book is a bit difficult to read, the first few chapters are vivid and interesting, and are the essence of the whole book. Therefore, it is recommended that you read through the first few chapters of the book before learning Spring, and then go back and learn "Spring Practice" will be much smoother.

In my experience, to learn Spring thoroughly, the ultimate method is to read the source code (that's what I did at the time). After reading the core source code of Spring thoroughly, people will be really free (the so-called no truth, no freedom), not just right Spring is for the entire Java system. When you encounter other frameworks in the future, you can probably see the context at a glance. The so-called "mountain is not a mountain" state. But this is something for you, which can be used as a direction for your future efforts.

Just like learning the basics of Java, you must also take notes when learning Spring, and you must save demos in different categories.

To be honest, Spring is not easy for beginners, so it's best to have a good teacher take it. It doesn't take too long. Two class hours are enough. Then you can dial in in time when you encounter big difficulties.

In my experience, it takes about one to one and a half months to master Spring.

3. Other knowledge

Spring is the infrastructure of Java programming, but if you really want to enter the development of actual projects, there are some things you can't get around, including MySql, Mybatis, Redis, Servlet, etc., but if you are baptized by Spring, these things are relatively simple. In my experience, 1 month is enough.

4. Practice

To learn Java, it is definitely impossible to learn without practicing optics. But because it is self-study, there is no actual product for you to practice, but it does not matter, who has not done a graduation project in the university? In my experience, everyone’s favorite "student management system" is still a good practice system.

Regardless of the "student management system" logic is simple, but the sparrow is small and complete, including database design, Mybatis, Spring, SpringMVC, Servlet, Tomcat, etc. It is definitely a good partner for practice.

Also, although your learning focus is on Java, because you want to make a complete demo, front-end cooperation is definitely indispensable. Therefore, it is inevitable to learn some simple JS and HTML knowledge, but because the front-end is a big topic, you must control the boundary and do not lose sight of the other. As far as the "student management system" is concerned, on the front end, as long as it implements a simple page that contains table, textbox, and button, can send REST requests to the server, and can realize students' "addition, deletion, modification, and checking".

As a training project, the goal is to string together the main skill points of Java, so I am not seeking perfection (it is impossible), so 1 month is enough. .

At last

According to the above process, 4 months is just right. Of course, the Java system is huge, and there are many more advanced skills to master, but don't worry, these can be used in future work.

Learning to program is a process from chaos to orderly, so if you encounter knowledge points that you can’t understand for a while, you don’t have to be frustrated, let alone get discouraged. This is normal and no longer normal. It's just a moment of "people have the same heart and the same heart."

In daily teaching, I often give the following sentence to students, and I will give it to you today:

"The road is tortuous, and the future is bright!" Good luck!

Learn Java with zero foundation, welcome personal Java 10-year learning group: 3907814

Guess you like

Origin blog.csdn.net/weixin_49794051/article/details/111598621