Getting Started with Java in 30 Minutes

Technology is just a tool, documentation is just a manual, nothing more.

write in front

After working for more than 4 years, the blind man has gone through detours like an elephant, and he has also grasped something similar to the "essence of programming" by opportunism. Now I plan to review my programming career. Sharing here is also to consolidate and organize what we have learned before.

understand programming

I'll start with an analogy. The human brain is like a mainframe computer. For example, today you were scolded by your boss at work. When you got home from get off work, you took this memory out of the "hard disk", and then put it in the "memory" to "calculate" over and over again, and finally came to the conclusion that "the boss is a bastard", and then Then store it on the "hard disk". In this way, the "leader is a jerk" memory is permanently stored on your "hard drive".
I'll give another example. You buy a router, read the manual and fiddle with it in 5 minutes to get the routing configuration. So, have you memorized all the instructions? Obviously you won't.
We do the same with technology.
Don't try to remember the implementation details of each technology, because then you won't be able to remember such a huge amount of data in your lifetime. Your "hard disk" is limited, and your "memory" is also limited.
All you have to do is: I know where to find the answer to this question.
Don't put too much stuff into your head, it's stupid. keep you sane. Besides work, you have a life, don't you?

The gesture of knocking on the door of Java

Open the URL below, take a look at the table of contents, and you'll be back. Don't put too much experience into the details, just know where to look when you really need it.
Java rookie tutorial
This includes how to build the environment, the basic syntax of java, and some basic classes. You can even try programming in a simulated environment of the website.
Now you can try to follow the "instructions" to try to write Java programs.

bin directory

C:\Program Files\Java\jdk1.8.0_121\bin

The *.exe file in the bin directory is the executable file under Windows. It is all executable files in the java environment, where javac.exe, javaw.exe, jar.exe, javap.exe have their own functions. You can search for the respective effects, or ignore them. You just need to remember that this directory is the execution directory. That is to say, when you configure environment variables, tell windows that I have installed java here.
You may see the execute java -versioncommand in various beginner tutorials to confirm the successful installation of java. Then we will do it once.
Bring up cmd and
typejava -version

java version “1.8.0_121”
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

You can try typing java.exe -versionand it will output the same message. That is to say, you executed the *.exe file in the bin directory, that's all.
The environment variable is to tell windows that all exe files in this directory can be called directly in the command console.

Documentation

In theory, to learn a new language, you should go to its most primitive and official place to find "manuals". java was created by sun company and later acquired by oracle company, and the most authoritative address of java related api is java api .
Similarly, you don't need to memorize all the contents, you just need to remember that when you want to understand a certain class in detail, go to this website to find its detailed description.

jar包

Jar is a collection of java packaging classes, and can also be understood as the implementation of certain functions written by others. That is to say, most of the functions you need have already been written by someone. If you find such a jar, you can call it directly without having to rewrite it yourself.
For example, in the cornershop project, the jar in the https://github.com/caiyongji/cornershop/tree/master/WebRoot/WEB-INF/lib directory is the implementation of some functions written by the predecessors, which can be called in the code .

Troubleshooting

When you encounter a problem, whether it is google or baidu, you have to find a solution yourself. Java is a very mature and community-complete language. The problem you encountered must have been encountered by the predecessors.
Recommend several communities:
stackoverflow
blog garden
csdn

It's that simple?

It's that easy to get started. If you want to master it, you can write a few small programs. If you want to be proficient, read through the documentation and tutorials (through reading here, read them all, including any details). If you want to be proficient, you must understand all and all the content of java, and have your own understanding. In the process, if you try to skip any details, you are bound to take a detour.

I'm not the one who feeds the food, the knowledge is there.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325443260&siteId=291194637