Java learning Summary: a

Java features

1. simple and effective
2. portability
3. Object Oriented
4. interpreter
5 for distributed computing
6 has better performance
7. robust, preventive measures
8. A multi-threaded processing capabilities
9 having higher * security
10 is a dynamic language
11 is a neutral configuration

Java has three branches in the development of

A .Java EE (Java Enterprise Development)
two .Java SE (Java Standard Edition)
three .Java ME (Java embedded development)
the Java SE as the core of the whole technical architecture
because both the Java EE or Java ME technologies are based on Java SE foundation as a support.

Java is both an interpreted language is a compiled language

1. All java files are required to be compiled by "xxx.java" file becomes "xxx.class" files (bytecode file)
2. All programs are java (Java Virtual Machine in the java virtual machine, JVM ) running on. JVM interprets compiled by the "xxx.class" bytecode files. There is a realization of the JVM java cross-platform (portability) features, as long as the implantation of different versions of the JVM on different operating systems, then the java program can on each platform migration, to "write once, everywhere run".

The definition of the class

public class Hello{//定义一个类
	public static void main(String args[]){
	System.out.print("Hello World!");
	}
}

Simple format class definition:

[public]class 类名称{}

1. public class definitions : class name must remain consistent with the file name, otherwise the program will not compile in a "xxx.java" file can have only one public class.
2. class definitions : class name may not match the file name, but the generated class is defined name.
There may be multiple class definitions simultaneously in a "xxx.java" program, the compiler will be divided into different "xxx.class" file.
Note: All class names have to have their own naming conventions, the beginning of each word capitalized
example: TestDemo

Main method: main ()

The method represents a main program is the starting point, all the code are thus sequentially executed, the main method in java but also on a class as follows:

public static void main(String args[]){
	程序代码
}

CLASSPATH

CLASSPATH mainly refers to the running path of the class, default CLASSPATH refers to the current directory (current directory window is located) in the class, JVM classes will be loaded from a user-specified directory when the change. The implementation of a "xxx.class" file each time you use the java command will start the JVM, JVM CLASSPATH path given by the required load class files.

The difference between PATH and CLASSPATH

PATH: it is the operating system environment variables, referring to the program paths can execute the command;
the CLASSPATH: the implementation path for all "xxx.class" file, java command will use the "xxx.class" This path load required when performing file.

Java program step is as follows

1. Use javac to a "xxx.java" documents translated into "xxx.class" file.
2. Using java can perform a "xxx.class" file.

Java programs divided into two types: Java Application and Java Applet program

Java Applet is mainly embedded in a web page a Java program, basically no longer in use, and Application refers to the main method of the program.

Released five original articles · won praise 0 · Views 95

Guess you like

Origin blog.csdn.net/weixin_45784666/article/details/104013648