Derived from Java:
SUN has developed, launched in 1995, 96 years to launch JDK1.0 version
2009 was Oracle (Oracle) acquisition
James Gosling is called "Java father"
JavaSE: Java Standard Editoion Standard Edition
JavaEE: Java EnterPrice Edition Enterprise Edition
JavaME: Java Mobile Edition Mobile
Java language features:
Object-oriented (analog real world to solve practical problems)
Simple (with respect to C, C ++, etc., less code)
Cross-platform (operating system, database, server)
Java implementation mechanisms:
Compile, in execution (compiled into bytecode (.class files) -> execution interpreted in different virtual machines)
Environment configuration:
JDK (Java directory ToolKit) Java development tools: the JRE + + class library development tools
JRE (Java Runtime Environment) Java Runtime Environment: by the JVM + interpreter composition
JVM (Java Virtul Machine) virtual machine: using software on different operating systems, the same simulation environment running
The reason the configuration of the environment: For any directory can run Java programs
Step: First JAVA_HOME variable value from a value JDK installation path, the variable referenced in the Path and into the bin file,% JAVA_HOME% \ bin
DOS command:
Create a folder md * (make directory)
Delete the folder rd * (remove directory)
Create a file echo
Delete files del * (delete)
Check the directory dir (directory)
Switching disk disk:
A cd (change directory) into the next
Exit one cd ..
Retreated to the root directory cd \
清屏 cls(clean screen)
Copy copy the source file path name of the target file path name
Shear move destination file path to the source file
Exit exit
First Java program
class HelloWorld{
// main function entry, the program
public static void main(string[] args){
// output
System.out.print("Hello,World");
}
}
A source file can have a plurality of classes;
A source file can have only one public class (public-modified), and only consistent with the file name.
Package (packages)
Effect: the equivalent of a folder, file management bytecode (.class)
Usage: package package name (the first line in the source files, a plurality of intermediate connection packets.)
With a package compiled: Javac -d source file name .java.
With the package runs:. Java package name of the class name
Coding Standards (badly written crazy people)
Class name consists of one or more words, each word capitalized
Function names \ variable names: a lowercase word, multiple words capitalized from the start of the second initials
Package Name: All lowercase. Coated with a plurality of connection
Constant: all uppercase. Connecting a plurality of constants _
// single-line comment
/ * Multiline comment * /
/ ** documentation comment * / (generation external documents)