1 PackageCom.atguigu.java;2 /*3 Understanding 1: People open the door4 process oriented: people open doors5 Object-oriented:6 Person {7 Open (door) {8 door. Open ();9 }Ten } One A Door { - Open () { - } the } - */ - /*Understanding Two: People pack elephants in refrigerators - * Process oriented: 1) Open the refrigerator 2) put the elephant in. 3) Close the refrigerator door + * Object oriented: - * Person { + * Open (refrigerator) {refrigerator. Open} A * Operation (elephant) {elephant. Enter (refrigerator)} at * Close (refrigerator) {refrigerator. Close ()} - *} - * Elephant { - * - *} - * Refrigerator { in * Open () {} - *} to */ + Public classtestoop{ - the}
2. The relationship between classes and classes
1) Association relationship
such as: the relationship between Bank and customer class
class bank{ Customer Cust; } class customer{}
2) Inheritance Relationship
3) Aggregation Relationship
Gathered
Combination
3. Object-Oriented thinking concepts
Classes and objects are the core concepts of object-oriented
A class is a description of a kind of thing, an abstract, conceptual definition.
An object is an entity that actually exists for that kind of thing, and thus is also known as an instance (instance).
Everything is an object.
class = Car design drawing. Object = a real car.
The focus of object-oriented is the design of classes.
Defining a class is actually defining a member (member variable and member method) in a class.
4.Java members of classes and classes
Property: The member variable in the corresponding class. Field = attribute = member variable.
Behavior: The member method in the Shadow class. Method = Member (methods) = function.
Java Learning Diary------Object-oriented ①