Java First chapter Java language Overview Knowledge points

Source: Internet
Author: User

A lot of new features were added after 1.jdk1.5

2. Why to add an environment variable:

1. Path environment variable. The function is to specify the command search path, and when executing the command under the shell, it looks in the path specified by the path variable to see if the appropriate command program can be found. We need to add the bin directory in the JDK installation directory to the existing path variable, and the bin directory contains the frequently used executables such as Javac/java/javadoc wait, and after setting the path variable, you can execute the Javac/java tool in any directory.

2. CLASSPATH environment variables. The role is to specify the class search path, to use the already written classes, the premise is to be able to find them, the JVM is through the classpth to find the class. We need to set the Dt.jar and Tools.jar in the Lib subdirectory of the JDK installation directory to classpath, of course, the current directory "." must also be added to the variable.

3. Java_home environment variables. It points to the JDK's installation directory, and software such as Eclipse/netbeans/tomcat finds and uses the installed JDK by searching for java_home variables.

you typically need to configure the following variables:
JAVA_HOME = 你的JDK安装位置CLASSPATH = .;%JAVA_HOME%\libPATH = %JAVA_HOME%\bin
The first java_home is mainly for the back 2.
The second classpath specifies the location of the default class library, as set to the current directory and the Java_home lib directory
The third path is to add the Java bin to the system path so that the command line or other program can call Java, Javac, JAVAW and other commands. 3. source files end in. Java4. There can be multiple classes of class life in the source file5. The Main method (that is, the main () method) in a class can have a fixed format: public static void Main (string[] args) {}The 6.main () method is the entrance to the program, which is the execution part of the program .there can be only one class declared public in 71 source files, and the class name of this class is required to match the source file name. 8. Execute the program: ① compile: Javac.exe compile, generate a lot of. Class bytecode files. ② Run: Java.exe9. Multi-line annotations cannot be nestedThere are eight basic data types in 10.javarespectively forinteger int,4 byte -231 ~ 231-1 short-integer short,2 byte -215 ~215-1 Long integer long,8 byte -263 ~ 263-1 byte type byte,1 byte -128 ~ 127 BOOL Boolean,character Char,single-precision floating-point number float,4 byte -3.403E38 ~ 3.403E38 double-precision floating-point number double 8 byte -1.798E308 ~ 1.798E308

Java First chapter Java language Overview Knowledge points

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.