Java Basics: Beginners Java language Introductory classic articles

Source: Internet
Author: User
Tags contains exception handling reference versions java web linux
Beginner

Java always has its thousand-plus advantages so that you can choose it, but it's just a matter of flipping through books or browsing around the Internet to find the answer. In this paper, the author of their own learning Java experience and the process of writing out, for beginners to make a reference.

I study Java in the process mainly around the following aspects to learn:

1. Always remind yourself that Java is an OOP language tool, not just code, only in order to master and use Java.

2. In the process of learning, it is best to understand the underlying mechanism of Java, rather than just stay on the surface, not transcription on the example to run the results. Be aware that even a simple example has to be patient to ponder, debug, and change.

3. In the process of learning must do, write code, instead of holding a book to see the line. Many things and experience must do their own to truly belong to themselves, it is best to participate in a number of practical projects.

4. After a certain stage, you begin to hope to do something with what you have learned. At this time you should start to learn some more, more complex knowledge, such as the Java-EE platform construction, EJB development and so on. For this part, I suggest that it is best to find a thin book first to understand a general, in the mind has an overall understanding of more technical terminology to do a preliminary grasp. I think this is a good time to take a look at the technology practice of Java EE, which gives you an idea of the various technologies and frameworks that Java EE contains, and provides many practical examples to deepen the overall understanding of Java EE.

Learning Java's interest and determination has played a key role. With this foundation in place, I began to learn Java step-by-step.

Building a Java environment

To run the Java program, you must install the JDK. The JDK is the core of the entire Java, including the Java compiler, JVM, a large number of Java tools, and the Java base API.

The JDK can be downloaded from http://Java.sun.com, with 1.4 versions and 1.31 versions. In my learning environment, first of all, the 1.31 version is used.

Unzip the installation. Then, make the environment settings.

1. For the Windows platform, make the following settings:

Set Path=your_install_ dir\bin; C:\Windows; C:\Windows\Command

Set classpath=. ; Your_install_dir\lib\tools.jar

2. For Linux platform to edit/etc/profile file:

Java_home=your_install_dir/jdk/j2sdk

Classpath= $JAVA _home/lib/tools.jar: $JAVA _home/lib/td.jar: $JAVA _home/jre/lib/rt.jar:.

Path= $PATH: $JAVA _home/bin

Export PATH PS1 USER LOGNAME MAIL HOSTNAME histsize histfilesize

INPUTRC java_home CLASSPATH Resin_home

Finally, enter Java on the terminal to see if you can find this command, if you find the installation is successful.

Here are a few important commands for JDK:

The Java Execution tool is the command to start the JVM (the virtual machine) and execute class (BYTE CODE) files;

Javac compiler, generating. class files from. java files;

Jar Java compression packaging tools;

Javadoc Document Builder.

Finally, JDK documentation, which is the JDK's online help document, is the most useful and important learning reference document that should be read more.

Start writing your own code

Now that the environment is in place, you should write a simple code to test it. Or start with the classic "Hello word".

1. First write a code with the editor (I'm using Linux VI):

[Stone@coremsg work]$ VI Hello.java

public class hello{

public static void Main (String []ARGC) {

System.out.println ("Hello word!");

}

}

2. Compile:

[Stone@coremsg work]$ Javac Hello.java

3. Perform:

[Stone@coremsg work]$ Java Hello

Hello word!

It worked! This is my first Java program. From then on I knew that I had started to go into the Java world, and then I made my own effort. In this process, I think there are a few points to be noted.

To learn a new language, reference books are inseparable from. My advice is to start by looking for a shorter introductory book to learn the simplest and most basic things, including learning Java syntax. At the same time, for one of the simplest procedures should also be more to debug, think about what happens if you change the results? Why do you have to write that? Think more about these problems and then go to work, and you will have more to gain. It is useful to think like this over and over again. In addition, you should see the JDK's online help at this stage as much as possible with the Java Basic Class library APIs provided by the JDK.

After having a certain foundation, can write some simple program, can begin to see "Thinking in Java" this book. It introduces the syntax of Java, object-oriented feature, core class library and so on. Through this level of learning can deepen the understanding of Java and the application of the underlying principles, but also a complete understanding of the entire Java system. At this stage, we should focus on the characteristics of Java object-oriented programming language, such as inheritance, constructors, abstract classes, interfaces, the polymorphism of the method, overload, overlay, Java exception handling mechanism, etc., to have a very clear understanding of the above concept. The purpose of this is to allow yourself to apply these techniques to practical programming (e.g., you will consider whether a class is designed with abstractions or interfaces). This requires a lot of practice to be applied and studied. This is also a lot of friends gave me the advice.

Learn More

If you want to use Java to complete a variety of more powerful tasks, then you need to learn more than the language.

1.Java Web Programming

For Java WEB Programming, you should and must be familiar with and master the HTTP protocol, you can refer to Stevens's "TCP/IP detailed" Volume III. 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 stage of learning should master servlet/jsp Web programming.

2. The study of Java EE

The Java EE contains too much technology. If you want to sit at the table with a large pile of books to learn, the effect is not good. I suggest that at the beginning of this stage of study, you can follow the following steps to do, the general idea is "overall grasp, each and every one."

Learn the meaning of technical terms in Java EE.

My feeling is that Java EE standards involved in a variety of technologies, if the beginning of a one to learn words is not realistic, but also ineffective. My advice is to first have a general understanding of the technology, such as EJB, Javaidl, JTA, and so on. You may not know how to write an EJB, but you know what EJB is, what it can do, and when you have this concept, it will be much quicker to learn it purposefully. I would like to say one more thing--you have to do it in practice.

Understand the design pattern in Java EE, this can help you to do a whole grasp of the Java EE.

The MVC development model has proved to be one of the effective methods of processing. It can separate data access and data performance. You can develop a scalable, extensible controller to maintain the entire process. At this level of learning, when you are faced with a project, you should first grasp the design of its overall architecture, as well as decide which technologies to use the Java standard.

Learn some typical examples of Java platform, deepen the concept and understanding of this technology.

Usually can pay more attention to this aspect, familiar with some typical cases, analysis of why it should use that time? What is the purpose of doing that? Then contact your side of the project whether it can be used as a reference.

Learn the various techniques under the Java EE.

In the first few stages of learning, you can build a Java-EE platform to start specific learning each technology. You can participate in the company's related projects to learn, you can build a platform to learn. At this time should find some relevant books to learn step by step, there is no shortcut to go. If you are not satisfied with these, you should also learn more about UML, design patterns and so on.



Related Article

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.