Use keyword

this keyword

The structure can be called: properties, methods, constructors

this call properties, methods: put this understanding into the current object or objects currently being created

this call the constructor:

  1. In the constructor for class, it can be used in display this(形参列表)mode, call other constructor class specified in the present
  2. The constructor can not this(形参列表)invoke its own
  3. this(形参列表)It must be declared at the beginning of the line current constructor
  4. Internal constructor, a statement can only this(形参列表)be used to call other constructors

The package keyword

Instructions for use:

  1. In order to better manage the class project to provide a package concept
  2. Package, use the package statement declaring class or interface belongs to the first line in the source file
  3. Packet identifier belongs to, follow the naming rules for identifiers
  4. Each .one represents a layer of the file directory

import keyword

Instructions for use:

  1. The import configuration file displayed in the source package introduced under the specified classes, interfaces,
  2. Disclaimer declared between classes and packages
  3. If you need to import to a structure, it can be tied to write
  4. Use xxx.*mode, it represents import xxxall structures of the package
  5. If the class or interface is used java.langunder the package defined, you can skip importstructure
  6. If the class or interface is defined under this package, you can skip the importstructure
  7. If the source file, the name of the class used in different package, at least one class must be displayed in a manner of full class name
  8. Use xxx.*way shows that you can call xxxall the structures under the package. But if the structure in which sub-packets of the packet, the display is still a need to import
  9. import static: Introducing the specified class or static structure (properties or methods) interface
Published 165 original articles · won praise 8 · views 8992

Guess you like

Origin blog.csdn.net/wait_13/article/details/104323992