The concept of super:
A. Super. Method names call methods of the parent class
B. Super () Represents the constructor method for calling the parent class
The object of the parent class is created by default when the subclass object is constructed, regardless of whether the super () is forced to write
Things that cannot be inherited:
1. Property or method of privatization
2. Access rights
3. Construction method (no inheritance is performed when an object is created)
The subclasses of different packages in this similar package
Private can not do not can not be
The default may not be able to not
Protected can not be able to
Public can be used to
Execution order of construction methods (with static block contents)
First, the contents of the static block of the parent class-"subclass" are executed in priority order.
The construction method executes sequentially from the parent class--The child class
Rewrite
Subclass inherits Parent Class overriding method of parent class if forced override loses reference to parent class method
Abstract classes and abstract methods
1. An abstract method is defined in the parent class so the subclass must implement this method
2. The parent class has an abstract method then the parent class must be an abstract class
3. If subclasses do not choose to implement this method subclasses must be defined as abstract classes
Judge:
Abstract class must have abstract method (F) dispensable
Classes with abstract methods must be abstract classes (T)
Final
1. Defines that the value of this property on the attribute is not allowed to change
2. The definition on the class indicates that the class is the final version cannot be inherited
3. The definition means that the method is not overridden by a quilt class
4. Defined on the construction method (meaningless direct error)
8 Basic data types:
Integer byte short int long
Float type float Double
Character Char
Boolean-Type Boolean
Implementing object-Oriented Programming with Java (2)