Java always has its thousands of benefits to make you choose it, but these can be easily turned over the book or a circle on the Internet to find the answer. In this article, I have learned some of my own knowledge of Java and the process of writing, for Java training
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 coding, in order to master and use Java in general.
2. In the learning process, it is better to understand the underlying mechanism of Java, rather than just stay on the surface, not the example of transcription run the results can be. Be aware that even for a simple example you have to be patient with your mind, debug, and change.
3. In the process of learning must be done, write code, instead of holding a book to look at the line. A lot of things and experience must be done on their own to truly belong to themselves, it is best to participate in some practical projects.
4. After a certain period of learning, you begin to want to do something with what you have learned. At this point you should start to learn some more and more complex knowledge, such as the construction of the Java EE platform, EJB development and so on. For this part, I suggest that it is better to find a thinner book first to understand a general understanding, in the heart of the overall knowledge, more technical terminology to do a preliminary grasp. I think this is a good time to look at the "Java EE Technology Practice", which allows you to understand the various technologies and frameworks included in the Java EE, and provides many practical examples to deepen the overall understanding of the Java EE.
The interest and determination to learn Java play a key role. With this foundation in place, I began to learn Java step by step.
Building a Java environment
To run a Java program, you must install the JDK. The JDK is the core of the entire Java, which includes the Java compiler, the JVM, a large number of Java tools, and the Java base API.
You can download the JDK from http://Java.sun.com, with version 1.4 and version 1.31. In my learning environment, first of all, the 1.31 version is used.
Unzip the installation. Then, make the environment settings.
1. The following settings are set for the Windows platform:
Set Path=your_install_dir\bin; C:\Windows; C:\Windows\Command
Set classpath=.; Your_install_dir\lib\tools.jar
2. To edit the/etc/profile file for the Linux platform:
Java_home=your_install_dir/jdk/j2sdk
Classpath= $JAVA _home/lib/tools.jar: $JAVA _home/lib/td.jar: $JAVA _HOME/JR
-e/lib/rt.jar:.
Path= $PATH: $JAVA _home/bin
Export PATH PS1 userlogname MAIL HOSTNAME histsize histfilesize
INPUTRC Java_home Classpathresin_home
Finally, enter Java on the terminal to see if you can find this command, if you find the installation is successful.
Here are some important commands for the JDK:
The Java Execution tool is the command that starts the JVM (virtual machine) and executes the class (bytecode) file;
Javac compiler, generates. class files from. java files;
Jar Java Compression Packaging tool;
Javadoc Document Builder.
Finally, JDK documentation, which is the JDK's online help document, is the most useful and important learning reference document and should be viewed more.
Start writing your own code
Now that the environment is there, 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 the VI of Linux):
[Email protected] work]$ Vihello.java
public class hello{
public static Voidmain (String []ARGC) {
System.out.println ("helloword!");
}
}
2. Compiling:
[Email protected] work]$ Javachello.java
3. Implementation:
[Email protected] work]$ Javahello
Hello word!
It's a success! This is my first Java program. Since then I know that I have started to enter the world of Java, and then rely on their own efforts. In this process, I think there are a few points to note.
To learn a new language, reference books are inseparable. My advice is to start by finding a shorter introductory book to learn the simplest and most basic things, including learning Java syntax. At the same time, to one of the simplest program should also be more debugging, think about what will happen if you change it? Why do you have to write like that? Think about these questions and then go to work, and you'll get more out of it. It is useful to think over and over again. In addition, you should look at the JDK's online help at this stage and try to master the Java Basic Class Library API provided by the JDK as much as possible.
After a certain basis, to write some simple procedures, you can start to read the "Thinkingin Java" this book. It introduces the syntax of Java, object-oriented feature, core class library and so on. This level of learning can deepen the understanding of Java and the use 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's object-oriented programming language, such as inheritance, constructors, abstract classes, interfaces, methods polymorphism, overloading, overwriting, Java exception handling mechanism, to the above concepts have a very clear understanding. The purpose of this is to allow yourself to apply these techniques to practice for reasonable programming (for example, you would consider whether a class is designed with abstraction or interface). This requires that a great deal of practice should be applied and studied. This is also a lot of friends to give me advice.
Learn More
If you want to use Java to accomplish a variety of more powerful tasks, then you need to learn more than the language of things.
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" third volume. Java servlet technology provides the ability to generate dynamic Web page content, which is one of the most basic features in your Java project, so you must learn. Through this stage of learning should master servlet/jsp Web programming.
2. The study of the Java EE
The Java EE contains too many techniques. If you want to sit at the table and hold a pile of books to study, the effect is not big. I suggest that at the beginning of this stage of learning, you can follow the following steps to do, the general idea is "overall grasp, conquer."
Understand the meaning of technical terminology in the Java EE.
My feeling is that the Java EE standard involves a lot of technology, if the first one to learn the words are unrealistic, but also ineffective. My advice is to have a general understanding of the technology, such as EJB, Javaidl, JTA, etc. You may not know how to write an EJB, but you know what EJB is, what it can do, and when you have such a concept, it will be much quicker to learn it purposefully. I would like to repeat that-it has to be done in practice.
Learn about the design patterns in the Java EE, which will help you grasp the Java EE as a whole.
The MVC development model proves to be one of the effective methods of processing. It can decouple data access and data performance. You can develop a scalable, scalable controller to maintain the entire process. Through this level of learning, when you face a project, you should first grasp its overall architecture design, and decide to adopt the Java EE standard of which technologies.
Learn more about the typical case of the Java EE platform and deepen the concept and understanding of this technology.
Usually can pay more attention to this aspect, familiar with some typical cases, analyze why it should use that time? What is the purpose of doing that? Then contact the project around you can be used as a reference.
Learn the various technologies under the Java EE.
In the first few stages of Java EE training
After learning, you can set up a Java EE platform to start specific learning each technology. You can participate in the company's related projects to learn, you can also build a platform for learning. 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 in depth
Uml
, design patterns, and so on.
Introduction to Java Novice