Internal class, package, modifier, block

Internal categories:

Internal class concept: the class to write inside other classes, can be written in other members of the class location and local location, then write in other classes inside the class is called inner classes. Other categories also called external classes.

 Members of the inner class is divided into inner classes, local inner class, inner class can access all members of the outer class directly.

Internal class members: defines the position of the external members of the class.

Access mode: the external name class . Inside class name variable name = new outer class name () .new inner class name ();

Internal local class: define local position outside the class method.

Access ways: in an external class method, create internal class object access

 

 

package:

java package, in fact, our computer system folder, the bag is stored in class files.

Class package statement format: Package Penalty for package name . Package name . Package name ...;

import guide packet format: import package name . class name ;

 

 

Modifiers:

public: modification of all classes in all packages

 

protected: Modified classes and subclasses present other package packet

default: Modified all classes present in the package

private: modifications of this class

 

 

Block:

Partial block: a partial block is defined in the statement or the method

Block configured: defined in the class code blocks in the position of member

Static block of code: defined position in the member, using static modified

 

 

 

 

Guess you like

Origin www.cnblogs.com/boss-H/p/10935780.html