10.5 Summary of class structure

  1. using java package structure dividing each functional class, the class name may be resolved during development than the generated duplication.
  2. Use the keyword in java package a class into a package, the nature of the package is a directory, in development often requires the definition of a parent based on their own development environment sub-package name and the package name, in standards development in all classes must placed inside a package.
  3. Use the import statement in java, you can import an existing package.
  4. If you import a class with the same name in different packages of a program, when you use must be clear that the name of the package, both "package. The class name."
  5. Java access control permissions are divided into 4: private, default, protected, public.
  6. Using the jar command to a package labeled as a jar file for users.
  7. Multi singleton design pattern and design pattern requires constructor must be privatized, while the need to provide good examples within the class object, using the external reference type to be used is transmitted.
  8. After enumeration type provides JDK1.5 define multiple can simplify design pattern, and can provide more abundant class definition means.
  9. Enumeration enum keyword defined Enum default inherit parent class constructor method Enum class definitions use the protected rights, and to receive enumeration name and number (generated automatically according to the order of the enumeration object definition).
Published 162 original articles · won praise 9 · views 3095

Guess you like

Origin blog.csdn.net/ll_j_21/article/details/104697722