Behavior of Java objects
1. The behavior of the object includes the definition of the object and the invocation of the object (advanced post-Stack)
2. Formal parameter arguments
Formal parameters are defined in a method declaration by using the
An argument is used when a method call
3.Java is passed by value, so there is a difference between the base type and the reference data type.
The basic data type passes the value in, and the reference data type is passed in.
4. Method overloading
That is, the name of the method is the same and the parameters are different.
Different parameters include different number of parameters, different types, or different order.
5. Constructors
function is used to create objects
Can be overloaded and can have arbitrary permissions.
When the permission is private, it is a single state.
6.this and Super
Only the first row can exist in the constructor, so only one appears.
The specific difference:
. ()
This invokes the object's other constructors for the property or method of the current object
Super invokes the constructor of the parent class by calling the parent class's property or method
Behavior of Java objects