Java history
Sun's 1995 launch, secure, portable, cross-platform, was acquired by Oracle in 2009.
Java architecture: SE standard EE enterprise version me mobile
Java Cross-platform principle: Java source code--Compile--java bytecode (cross-platform)--run in Java Virtual Machine--on Mac platform, Linux platform, Windows platform.
Java Virtual machine: a virtual computer system that can run Java bytecode, he has an interpreter component that enables communication between Java bytecode and computer operating systems, different platforms, different JVMs, and he plays the difference between shielding the underlying operating platform.
Garbage collector: The JVM provides a system thread to track the recipe for storage space and, when idle, checks and frees the storage space that can be freed.
Download and install the JDK to understand the directory structure of the JDK, Javac.exe is the program that compiles the source code into bytecode, and the Java.exe is the program that executes the byte code.
Configure environment variables: Add the Bin directory path under the path system variable.
Java program Development Three steps: Write the source program with. Java as the suffix, compile the source program--Generate a bytecode file with the suffix. Class--JVM Run the program
Write HelloWorld Program--javac command compiler--java command Run program
Instance:
public class helloworld{
public static void Main (string[] args) {
System.out.println ("Hello world!");
}
}
Three kinds of comments://single-line Comment/** Document comments */* Multiline comments */
Java is strictly case-sensitive, the code is divided into structure definition statements and function execution statements, function execution statements must end with a semicolon.
Java Common Development tools: 1, Text editor EditPlus 2, integrated development environment eclipse
Java Anti-compilation tool: Cavaj java Decompiler
Variables: Local variables and member variables, basic data variables and reference type variables
Eight data types: Boolean 1 bytes True false default False
byte type byte 1 byte -128--127 default 0
Short integer 2 bytes-2 of 15 square to 2 15-square minus 1
Integer int 4 bytes-2 of 31 square to 2 31 minus 1
Long 8 bytes-2 of 63 square to 2 63-time minus 1
Character Char 2 byte 0--2 16-time-square minus 1
Single-precision float float 4 bytes
Double-precision floating-point double 8 bytes
Declaration of the base data type:
Java Notes (i)