Why do you learn Java and understand the code, but you can't write it by yourself?

Regarding this issue, it must be a psychological process or "speaking" that many people have, but the real reason is not that you said "I can understand, but I can't write it", the real reason is and The problem is that you didn't learn it when you were studying, and didn't know how to learn Java programming correctly. According to the specific reason of this problem and how to solve this problem, I will explain it in detail below with you today.

 

"I can read the code, but I can't write it by myself". I said this myself when I first started, but after I write the code, I will find that such a statement is ignorant. I didn’t look into the root cause carefully. The expression "understandable" can be said to be memorable, or to understand English, similar to memorizing vocabulary, so of course you can understand it, and learning Java programming is to use code. To write a good Internet product, I didn’t understand the code at all. When I know how to write code myself, I feel that what I have said is very face-off. The person who really understands the code understands what the business logic is, instead of understanding the English words, let him write one He can type out the function independently, so that he really understands it.

 

I think there are two situations where I can't write code:

One is that there are ideas, but the grammatical structure of the Java language is not particularly familiar, so the code cannot be written.

One is that the grammatical structure of the Java language is fairly good, but there is no way to solve the problem. I personally think that this situation is too much, or that it is not good at the grammatical structure of the Java language, and at the same time. Thinking, there are more cases like this.

Regarding the first situation, I think it is a relatively easy solution. Watch the video several times carefully and master the basic knowledge of Java. It is easy to solve it. As long as you are not lazy, there is no problem.

 

For the second case, it should be a difficult problem that everyone will encounter in the learning process. Often we do not know the overall construction idea for a function or a topic. This is also a difficult problem at the beginning of learning Java. My suggestion is "Imitate first, then create". This is a process of accumulation. When we watch the code in the video or book, we should focus on the ideas of others in solving problems. This is a person who knows how to learn. The necessary skills are not just to copy his code. Everyone has their own learning habits. They organize and summarize more by themselves. If they see more, they will gradually have the idea of ​​understanding the problem. This is similar to primary school students. Learning Mathematical Olympiad is a principle, quantitative changes cause qualitative changes.

 

Mental disorder

For novices who are just starting to learn Java, there may be some psychological barriers to fear writing code. To be honest, when I first started learning Java, I recalled that I had this feeling before. My subconscious mind hinted that I couldn’t write and couldn’t write it. Then I really just watched the video instead of writing code. In the learning process, the habit of being unwilling to do it will gradually develop, and learning a skill often depends on the ability to do it. This is also one of the factors that make oneself unable to write code in the end.

In this regard, I must repeatedly emphasize to everyone that "think more", "think more", "think more", "hand write", "hand write" and "hand write". Neither head nor hands should be lazy. Lazy hands only have theoretical knowledge. , There is only a numb copying machine left for the lazy head. Whether watching a video or reading a book, after we have seen the general idea of ​​a program, we close the book or turn off the video, and then write the code according to our own ideas. Don’t think about what each piece of code in the video is, but focus on The problem we want to solve and what kind of function we want to complete, think about how the code ideas in the video are completed. At the same time, I have to remember in my mind what similar programs I have written or read, imitate the programs I have been in contact with, and finally write the complete code idea. This is the most correct learning process and idea. In fact, there are many People don't know how to learn by themselves. They need others to guide them on the right path. Learning habits take a long time to develop.

 

You must start to write code. It is impossible for a person without a large amount of code accumulation to engage in Java development work. To use a Taoist saying: Dao produces one, one life two, two produces three, and three produces all things. The procedure is the same. Only if you learn the first procedure, you will have the second procedure. It doesn't matter if you can't write it out. We can start with the simplest, from simple to complex, but we must have perseverance and continue to learn. The code accumulates from ten lines to a hundred lines, then to a thousand lines, and then to ten thousand lines, gradually increasing. When you accumulate enough, you now think that you "can understand the code, but cannot write "The rhetoric no longer exists.

 

At last


If you want to learn Java, I will share some Java learning materials with you. You don’t have to waste time searching everywhere. I have compiled all the materials from Java entry to proficiency. These materials are all made by me. The latest Java learning routes compiled in the year, Java written test questions, Java interview questions, Java zero-based to proficient video courses, Java development tools, Java practice projects, Java e-books, Java study notes, PDF document tutorials, Java programmers’ experience, Java job resume templates, etc. These materials will definitely help you learn Java in the future. It is a must for every Java beginner. Please enter my Java technology qq exchange group to download by yourself . All the materials are in the group. In the file, you need to communicate and learn more with you when you go in.

Guess you like

Origin blog.csdn.net/deqing271/article/details/115183446