1/Anonymous Class object: The object that created the class is anonymous.
For example , new Circle() is an anonymous class object.
Anonymous class objects can only be used once.
2/formal parameter: When declaring a method, the parameters within the method parentheses
Arguments: The calling method is the value of the actual passed-in parameter
3/rule: In Java, value passing is performed.
A parameter is a variable that passes the value of an argument to the base data type of the base data type
A parameter is a reference to a data type, and the value of the argument's reference type variable is passed to the reference of the formal parameter
4/object-oriented feature one: encapsulation
* objects are created after the object of the class is passed directly. property is assigned to an object, an unexpected occurrence may occur that is not true. We consider that the object is not directly acting on the property, but through the object . method to control the object's access to the property. We are now privatizing the properties in the class.
the property of the Private adornment can only be called in the original, that is, it is called in a common way.
Encapsulation Idea: privatization of properties, providing common methods (such as set and get methods).
5/Permission modifier:Public Private default state (default)protected
Can be used to modify properties and methods.
6/this can be used to modify properties / methods / constructors.
This is understood as the current object or the object that is currently being created.
This (formal parameter) can explicitly call other overloads of this class for the specified constructor.
This (); The constructor that called the null argument.
If there are N constructors in a class, there is a maximum of n -1 constructors used this ();
Public person (String name) {this.name =name;} Public person (String Name,int age) {this.name = Name;this.age = age;} Can be written as public person (String name) {this.name =name;} The public person, String name,int age, {this (name);//syntax requires this statement to be written in the first row of the constructor this.age = age;}
7/javabean is a reusable component written in the Java language.
Compliant: The class is public/has a parameterless public constructor/attribute, and has a corresponding Get/set method of the Java class, which is JavaBean.
8/UML Chart
Java Foundation Day7