Java basics 007-Package
Learning Java at the age of 35
Package 1.1 (Package) 1) manages class files by category. 2) provide multiple namespace for the class. 3) Write it in the first line of the program file. 4) The full name of the class name is the package name. Class Name. 5) package is also a form of encapsulation.
1.2 classpath1) an environment variable provided to JVM. 2) Specify the path of the class or package. 3) The last semicolon of the classpath variable value is different from that without a semicolon.
Access between 1.3 Packages 1) the class permission in the accessed package must be public. 2) member permission in the class: public or protected3) protected is a permission provided for the subclass in other packages.
1.4 four Permissions
1.5 import1) simplified class name. 2) There is only one package in a program file and there can be multiple imports. 3) it is used to export classes in the package and does not import packages in the package. 4) usually write import mypack. Demo; 5) instead of importmypack. *; why? What to import!
1.6jar package Java compressed package is convenient for the project to carry. For ease of use, you only need to set the jar path in classpath. Database drivers and SSH frameworks are all embodied in jar packages.
The operations of 1.7jarpackage allow the operations of jar.exe on jar. Create a jar package: jar-CVF mypack. jar PACKA packb: jar-tvf mypack. jar [> targeted file] decompress: jar-xvf mypack. jar custom jar package configuration file: jar-cvfm mypack. jar mf.txt PACKA packb