a [i] [j] = new integer (i * j);
}
}
7: The class is only two kinds of public and default. Methods and attributes have four kinds.
8: You cannot inherit the structure of the constructor is private
9: The variables defined in the function can only default; 10: The constructor of the class is private, and the STATIC function returns to the class by defining the Static function of the class, or the STATIC variable of the class, the latter can only produce a class object.
201 garbage collection
10: The definition of constants is often public static final, which may be a compiler constant, which may be an execution period. Final variables that are not initialized at the definition must be initialized in the constructor. When the final parameter is equivalent to the PL / SQL IN, the normal condition is in Out
The final function is that the subclass cannot be changed, and the Final class cannot be inherited.
11: When the class is loaded, the Static variable, STATIC block is initialized, and the Static method is called when used.
12: Initialization Sequence: Load base class, subclass à base class, STIC initialization à Variable Settings Settings and Nullà If there is new, the primary class constructor is initialized after the definition is the base class constructor, the subclass constructor.
à is just using Static variables, and the variable definition is still not initialized. First constitute a base class talents.
13: Do not call non-final and private type functions when the constructor and the constructor are initialized, otherwise it is possible to call the methods overwritten in the subclass. P241
A class is not a child, but actually calls the actual subclass when using the parent class.
14: The data member in the interface automatically produces a constant group for public static final, and the function is automatically public
15: Nested Private Interface in class can be implemented as a public, private class in a nested class, but such a class that implements the Private checkbox interface can only be manipulated by a class of its use. P259
16: The peripheral and peripheral interface can only be public and default, and the inherently hidden can be any.
17: The function in Interface is automatically used for public. When INTERFACE is implemented as public, the data in Interface is public static final, but it cannot be Blank Final, because Blank Fiel needs to initialize in the constructor. Can be an execution period initialization Final, such as Final INT i;
i = new random (). Nextint ();
17: The interface nested in the interface can only be public
17: You can expand Interface17 by extends: Anonymous Class can implement interfaces, can inherit, but the parent class of anonymous class has a non-default constructor, simply incorporate parameters when NEW can be introduced. Because of the unwilling function, the way to initialize the entity {INT A; A = a;
18: Other objects used in anonymous class must be named Final
19: Non-Static Inner Class object has a reference to the Outer Class, so you must have an Outer object when you generate a non-Static Inner Class, and you can access any peripheral objects. The Static Inner Class object does not require a peripheral object when the peripheral object is generated, and it is not possible to access the peripheral object.
20: Internal hidden category of Private implementation, after the reference is obtained in another type, it cannot be converted downward after reference to the interface.
21: Inheriting the hidden class, because the Outer class is required, the constructor of the inner hidden subclass requires a reference to a periphery. When inheriting the Outer class, the overwriting insiders have no effect, although there is no effect, but it can also be clearly pointed out: Inner class in the subclass inherit the Inner class in the parent class, and can be the same name, in this case, the father The INNER class generated in the class will not spread, that is, the INNER class in the subclass is generated. See P275
22: Non-STATIC in the outside must have an OUTER object. After you have an Outer object, you can pass the function or new, but you cannot directly NEW PRIVATE type. If the internal hidden class implements other interfaces, or inherits other classes, the transformation cannot be enforced down.
When you generate an Inner class object, you must have a reference to the Outer object, except for the Statc Inner class.
When you get an Outer class in Inner, you only need OuterClassName.THIS;
When you use the Static Inner class object in an outside, you can define a Static function that returns a Static Inner class object in the Outer class, and then call this function to get the Static Inner class.
Public class untricled2 {
Static class a {
INT i = 4;
}
Class B {}
A bb () {
// system.out.println (unstem2.this); àthis is non-Static
// new usd2 (). New a (); àa does not need Outer class, no
Return new a ();
}
B cc () {
New uns (). New b (); à must have Outer class,
Return new b (); à, so you can directly New, because you already have an Outer class object when CC ()
}
Public static void main (String [] args) {
A SDFS = New A ();
// new usd2 (). New a (); à no need, you can't have an Outer class object
// new b (); à no Outer object
B DD = New Untitled2 (). New b ();
}
}
Class mihu {
Static void lasjf () {
// new a ();
System.out.println (Untitled2.bb (). I); à Need BB () is static
// new b ();
NEW unTID2 (). New b ();
NEW Untitled2 (). cc ();
}