java package
A, java package used
1. Common package Introduction
- java.lang java core classes, to provide common functions, such as: String, Math, System and the like.
- java.util contains tools used, such as: definition of system properties, a set of frame-based interface, date.
- java.io class comprising a plurality of inputs and outputs.
- java.net classes and interfaces comprising performing operations associated with the network.
- jave.text contains some formatting related classes.
- java.sql JDBC database comprising programming for related classes and interfaces.
- java.awt contains building and managing the application image class interface (GUI), such as: Abstract Window Toolkit class (abstract window toolkits), etc.
2. Each package details
Second, build a package: package
1. The package statement
Package statement is the first statement java files, and at most one. The syntax is as follows:
package package name [package name.] [...] class name.;
2. Compile
Compile-time, it should be in the current directory of the parent directory in a package, such as: creating com.my.HelloWorld PACKAGE / Code directory, the compiler should be located at D:: in the D / Code position.
javac package name [\ package name] \ source files
3. Run
Run time, the directory location as described above.
java package name [. package name]. The main class
Third, the leader packet: import
Fourth, the basic data type classes that encapsulate
To be continued ...