JAVA basics: What are precautions for beginners of Java?

Source: Internet
Author: User
JAVA basics: What are precautions for beginners of Java? -- Linux general technology-Linux programming and kernel information. The following is a detailed description. Java always has a thousand benefits for you to choose from, but you can find the answer by simply turning over the book or visiting the internet. In this article, I will write some of my experiences and processes in learning Java for beginners to make a reference.

Zookeeper In the course of learning Java, I will focus on the following aspects:

Handler handler 1. Always remind yourself that Java is an OOP language tool, not just encoding. Only in this way can we grasp and use Java in an overall way.

Objective 2. in the learning process, it is best to understand the underlying mechanism of Java, rather than just staying on the surface, rather than running the results in the example on the copybook. You must be patient in thinking about, debugging, and modifying a simple example.

3. In the course of learning, you must do it and write code, instead of holding a book and reading it. Many things and experiences must be done by yourself to truly belong to yourself. It is best to participate in some practical projects.

Tips 4. What do you want to do after a certain period of learning. At this time, you should begin to learn more and more complex knowledge, such as the construction of the J2EE platform and the Development of EJB. For this part, I suggest you find a thin book to understand it first, and have a general understanding in your mind to get a preliminary understanding of more technical terms. I think it is good to see J2EE technical practices at this stage. It can help you understand the various technologies and frameworks contained in J2EE and provide many practical examples to deepen your understanding of J2EE.

The interest and Determination of  worker to learn Java play a key role. With the above basics, I began to learn Java step by step.


Build a Java environment

To run the Java program, JDK must be installed. JDK is the core of Java, including the Java compiler, JVM, a large number of Java tools, and Basic Java APIs.

Zookeeper can download JDK from the http://Java.sun.com, with version 1.4 and 1.31. In my learning environment, Version 1.31 is used first.

Unzip the installation package. Then, set the environment.

Platform lifecycle 1. perform the following settings for Windows:


Set PATH = YOUR_INSTALL _ DIR \ bin; C: \ Windows \ Commandset classpath =.; YOUR_INSTALL_DIR \ lib \ tools. jar


Optional bytes 2. Edit the/etc/profile file for the Linux platform:



JAVA_HOME = your_install_dir/JDK/j2sdkCLASSPATH = $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/td. jar: $ JAVA_HOME/jr-e/lib/rt. jar :. PATH = $ PATH: $ JAVA_HOME/binexport PATH PS1 user logname mail hostname histsize histfilesize inputrc JAVA_HOME CLASSPATH RESIN_HOME



Finally, enter Java on the terminal to check whether the command can be found. If the command can be found, the installation is successful.
The following describes several important JDK commands:

Optional bytes ◆ Java execution tool, which is a command to start JVM (Virtual Machine) and execute the class (byte code) file;

 ◆ Javac compiler, which is generated by the. java file. class file;

Unzip success ◆ jar Java compression and packaging tool;

 ◆ Javadoc document builder.

JDK Documentation is the final part of zookeeper. This is JDK's online help document and the most useful and important learning reference document.



Start writing your own code

Zookeeper now has the environment. You should write a simple code for testing. Or from the classic "hello word.

Author author 1. First Use the editor to write a code (I use the Linux vi ):

[Stone @ coremsg work] $ vi Hello. Java public class Hello {public static void main (String [] argc) {System. out. println ("Hello Word! ");}}


Compile into 2. Compile:



[Stone @ coremsg work] $ Javac Hello. Java



Worker 3. Execute:



[Stone @ coremsg work] $ Java Hello Word!



Zookeeper succeeded! This is my first Java program. Since then, I know that I have started to enter the Java World, and then I will rely on my own efforts. In this process, I think there are several points worth attention.

 Learning a new language is inseparable from reference books. My advice is to find a short getting started book to learn the simplest and most basic things, including learning Java syntax. At the same time, debugging should be performed on the simplest program. Think about the result if you change it? Why must I write that? Think more about these problems and then perform operations, which will give you more gains. It is useful to think over and over again. In addition, you should also look at the online help of JDK at this stage to learn as much as possible about the Java basic class library API provided by JDK.

After some basic and easy-to-write programs, Zookeeper can start reading Thinking in Java. It fully introduces Java syntax, object-oriented features, core class libraries, and so on. Through this level of learning, we can deepen our understanding of Java and the use of underlying principles, while at the same time, we can fully understand the entire Java System. At this stage, we should focus on learning the features of Java's object-oriented programming language, for example, inheritance, constructor, abstract class, interface, method polymorphism, overload, overwrite, Java exception handling mechanism, etc. You must have a very clear understanding of the above concepts. The purpose of doing so is to apply these technologies to practice for rational programming (for example, you will consider whether a class is designed using abstraction or interfaces ). This requires that you must apply and learn in a large number of practices. This is also the advice that many of my friends gave me.


Learn more

If Java is used to complete tasks with more powerful functions, you need to learn more than the language.

Java Web Programming

For Java Web programming, Zookeeper should be familiar with and master the HTTP protocol. For details, refer to Chapter 3 of "TCP/IP explanation" of Steven S. Java Servlet technology provides the ability to generate dynamic Web page content, which is one of the most basic functions in your Java project, so you must learn. Through this phase of learning, you should master the Web programming of Servlet/JSP.

Objective 2. J2EE Learning

Zookeeper J2EE contains too many technologies. If you want to sit next to a table and hold a lot of books to learn, it will not be very effective. I suggest that you follow the steps below when you start learning at this stage. The general idea is "overall control, break through each other ".

Technical Terms ◆ understand the meanings of technical terms in J2EE.

Zookeeper I think there are a lot of technologies involved in the J2EE standard. It would be unrealistic and ineffective to learn them one by one at the beginning. My suggestion is to have a rough understanding of the technologies, such as EJB, JavaIDL, and JTA. Maybe you don't know how to write an EJB, but you need to know what EJB is and what it can do. With this concept, it will be much faster to learn it purposefully. I want to repeat it again-it must be done in practice.

Introduction patterns ◆ understand the design patterns in J2EE, which helps you grasp J2EE as a whole.

The Zookeeper MVC development mode has been proved to be one of the effective solutions. It can separate data access and data performance. You can develop a scalable and scalable controller to maintain the entire process. At this level of learning, when you are facing a project, you should first grasp its overall architecture design and decide which technologies adopt the J2EE standard.

Tips tips ◆ understand some typical cases of the J2EE platform to deepen the concept and understanding of this technology.

Zookeeper can pay more attention to this aspect at ordinary times. He is familiar with some typical cases and analyzes why it should be used at that time? What is the purpose of doing so? Then contact your project for reference.

Technical Skills ◆ learn various technologies under J2EE.

After several stages of learning, Zookeeper can build a J2EE platform to learn each technology. You can participate in company-related projects or build a platform on your own. At this time, you should find related books to learn them step by step. There is no shortcut. If you are not satisfied with this, you should also learn more about UML and design patterns.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.