Dark Horse programmer-java

Source: Internet
Author: User
Tags create directory

-------Android Training, Java training, look forward to communicating with you! ----------

1. Features of JAVA
1) Simple (Java syntax is a "pure" version of the C + + syntax);
2) Portability (once compiled and run everywhere)
3) Object-oriented
4) Distributed (Java makes it easy to open socket connections and other tedious network tasks)
5) Robustness (the Java compiler will check for errors that are displayed by many other languages at run time; Java uses the reference
Pin model to eliminate the possibility of rewriting memory and data crashes)
6) Multithreading (the simplicity of multithreaded programming is one of the main reasons Java becomes a popular server-side development language)
7) Security (use Java to build anti-virus and tamper-proof systems)
9) Dynamic (Java can arbitrarily add new methods and instance variables, but the client does not need to make any changes)
10) Architecture Neutrality (bytecode is independent of computer architecture, as long as there is a runtime system, on a variety of processors
Implementation
2, the operation principle of JAVA
1) Compile: *.java file------------> *.class file
2) Run: *.class file-----> Load-----> JVM (Java Virtual machine)
3. Directory of JAVA
1) jre――――――― Operating environment
2) Src――――――― Class Library
3) bin――――――― application (binary, Java tools)
4) Demo――――――― Example
5) Include―――――――c Language
4. JDK (Java development Kit)
JDK is the core of the entire Java, including the Java Runtime (Java Runtime envirnment), a bunch of Java
Tools and Java-based class libraries (Rt.jar). Any Java application server is essentially a built-in version of the JDK.
So mastering the JDK is the first step to learning Java. The most mainstream JDK is the JDK released by Sun, with the exception of Sun,
There are also many companies and organizations that have developed their own JDK, such as IBM's Jdk,bea company's
Jrocket, and the JDK developed by the GNU organization, and so on. Where IBM's JDK contains the JVM (Java Virtual
Machine) is much more efficient than the JVM included with the Sun JDK. The Jrocket, which runs exclusively on the x86 platform,
Service-side operations are also much better than the sun JDK. But in any case, we need to get the sun JDK in the first place.
1) Download and installation of JDK (installation of JAVA development package)
1. Download (http://java.sun.com): JDK is also called J2SE (Java2 SDK standard Edition), you can
Download from Sun's Java Web site, http://java.sun.com/j2se/downloads.html, the latest version of the JDK
Is j2sdk1.4.2, it is recommended to download this version of the JDK, download page here: http:
Java.sun.com/j2se/1.4.2/download.html.
2. Install (run shell directly under Linux): The downloaded JDK is an executable installer that is installed by default
A set of JRE (for use by the browser) will be installed in the C:\Program files\java\ directory after completion, under C:\j2sdk1.4.2
Install a set of JDK (also including a set of JRE). Then we need to add the Java path to the front of the environment variable path
Diameter C:\j2sdk1.4.2\bin. The JDK is ready to install.
2) command tool for JDK
The most important command-line tool for the JDK:
Java: Start JVM execution class
Javac:java compiler
Jar:java Packaging Tools
Javadoc:java Document Generator
These command lines must be very familiar and proficient for each parameter. For the learning of these commands,
Detailed documentation is available on the JDK documentation.
5. Set Environment Variables (3):
1) csh (server)
Setenv JAVA_HOME/OPT/JAVA/JDK/JDK 1.5.0_06
Setenv path/opt/java/jdk/jdk 1.5.0_06/bin: $PATH
Setenv CLASSPATH.
2) bsh/ksh (native)
VI. BASHRC
Export JAVA_HOME=/OPT/JAVA/JDK/JDK 1.5.0_06//JDK installation path
Export PATH=/OPT/JAVA/JDK/JDK 1.5.0_06/bin: $PATH//operating system itself, does not belong to Java-specific
Export Classpath=. Set to point, default to the current directory
3). Check
Echo $PATH
. . BASHRC
Java
Javac
6, class loading mechanism: divided into four levels
1) Start the class loader $jdk/jre/lib/rt.jar
2) Extension class loader $jdk/jre/lib/ext

Import java.lang.*;p ublic class hellojava{public static void Main (string[] args) {System.out.println ("Hello J   Ava, so Simple "); }}


: Wq
(2) Compile: javac-d. Ch01/hellojava.java
Explanation: Javac (start compiler)-D. (under current directory) Ch01/hellojava.java
View Catalog: Dir (-D role: Create directory)
Without the first line of the package, you can omit the "-D. "Otherwise it must be added!"
(3) Run: Java Com.briup.ch01.HelloJava (Note that this is a full name)
If not in the current directory, use the command export classpath=? Modify the path (note?) Represent directory name
---------> Generally do not easily modify the established path, it is seldom used
or a temporary run: JAVA-CP? Com.briup.ch01.HelloJava


Dark Horse programmer-java

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.