Java has always had its best benefits to choose it, but these casually overlooks or visit the answer on the Internet. In this article, the author writes some of the body of Java to learn Java, and the scholars are given a reference.
I am studying in the process of learning Java to learn from the following aspects:
1. Always remind yourself Java is an OOP language tool, not just coding, only in this way will grasp and use Java.
2. In the process of learning, it is best to understand the underlying mechanism of Java instead of staying in the surface, not the example of the copy of the book. It should be noted that even if there is a simple example, there must be patience, debug, and change.
3. Be sure to do it during the process of learning, write code, not to hold a book to see it. Many things and experiences must do their own to really belong to themselves, it is best to participate in some actual projects.
4. After learning a certain stage, what you have begun to do what you have learned. At this time, you should start learning some more, more complicated knowledge, such as the construction of the J2EE platform, EJB development, etc. For this part, I suggest that it is best to find a thin book to understand a matter, there is a general understanding in my heart, and a preliminary master of more technical terms. I think this stage look at "J2EE technology practice" is very good, it allows you to understand the various techniques and frames included in J2EE, while providing a lot of practical examples to deepen the overall understanding of J2EE.
Learning Java's interest and determination has played a key role. After having the above foundation, I started learning Java step by step.
Java environment building
To run the Java program, you must install JDK. JDK is the core of the entire Java, including Java compiler, JVM, a large number of Java tools, and Java foundation APIs.
JDK can be downloaded from http://java.sun.com, with a version 1.4 version and version 1.31. In my study environment, I use the 1.31 version.
Unzip installation. Then, the environment is set.
1. For the Windows platform, you should do the following settings:
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 User Logname Mail Hostname HistSize Histfilesize
INPUTRC JAVA_HOME CLASSPATH RESIN_HOME
Finally, enter Java on the terminal can find this command, if you can find the installation, it is successful.
Let's introduce several important commands for JDK:
◆ Java execution tool is a command to start JVM (virtual machine) and execute the class (Byte code) file;
◆ Javac compiler, generates a .class file by .class file;
◆ JAR JAVA compressed package tool;
◆ Javadoc document generator.
Finally, JDK Documentation, this is the JDK online help document, is the most useful and most important learning reference document, should look more.
Start writing your own code
Now there is an environment, you should write a simple code for testing. Start from the classic "Hello Word". 1. First write a code with the editor (I use 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. carried out:
[stone @ Coremsg Work] $ JAVA Hello
Hello Word!
Success! This is my first Java program. Since then, I know that I have begun to walk into the world of Java, and I will rely on my own efforts. In this process, the author thinks there is a need to pay attention.
Learn a new language, the reference book is inseparable. My suggestion is to start finding a shorter entry book to learn the simplest, most basic things, including learning Java grammar. At the same time, it should be more debugged for a simplest procedure. Think about what results will occur if you change? Why do you have to write? Think more about these problems and then do it, you will make you more harvest. This is useful to think repeatedly. In addition, at this stage, you should also look at JDK online help, try to grasp the Java basic class library API provided by JDK.
After a certain basis, you can write some simple programs, you can start watching "Thinking In Java" book. It introduces the syntax of Java, object-oriented features, core class libraries, etc. Through this level of learning can deepen the application of Java's understanding and underlying principle, while you can fully understand the entire system of Java. At this stage, you should focus on learning the characteristics of Java's object-oriented programming languages, such as inheritance, constructors, abstraction, interface, polymorphism, overload, coverage, Java's exception handling mechanism, etc., to have the above concept Very clear understanding. The purpose of doing this is to let yourself apply these technologies into practice for reasonable programming (for example, you will consider a class to design, etc.). This requires the application and study in a large number of practices. This is also the suggestion that many friends gave me.
Learn more
If you want to use Java to complete a stronger task of various functions, then learn more other than 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' TCP / IP Details "Volume 3. 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. Learning through this phase should master the WEB programming of servlet / JSP.
2. J2EE's learning
J2EE contains too much technology. If you want to sit next to the table, you can learn a lot of books to learn, the effect is not big. I suggest that when I started this phase, I can do it in the following steps, and the general thinking is "overall grasp, all breaks".
◆ Understand the meaning of technical terms in J2EE.
My feelings are a lot of technologies involved in the J2EE standard. If I started to learn, it is unrealistic, and it is no effect. My suggestion is that there is a probably understanding of the technology, such as EJB, JavaIDL, JTA, etc. Maybe you don't know how to write an EJB, but you have to know what is ejb, what can be done, after having such a concept, then go to a destination to learn it is much faster. I have to repeat anything - I have to do it in practice.
◆ Understand the design pattern in J2EE, so you can help you make a whole grasp of J2EE. The MVC development model proves to be one of the effective processing methods. It can separate data access and data performance. You can develop a scalable, easy-to-extend controller to maintain the entire process. Through this level of learning, when you face a project, you should first grasp the design of its overall architecture, and how to decide which techniques in the J2EE standard.
◆ Understand some typical cases of J2EE platforms to deepen the concept and understanding of this technology.
Usually pay more attention to this, familiar with some typical cases, and analyze why it takes that time? What kind of purpose can you achieve? Then contact if the item around you can be used as a reference.
◆ Learn various techniques under J2EE.
After having a first few phases, you can build a J2EE platform to learn each technology. You can participate in the company's related projects, you can also build a platform for learning. At this time, you should find some books to learn step by step, no shortcut can go. If you don't satisfy these, you should also learn something in UML, design patterns, etc.