Object Oriented (i)
What is object-oriented
1. Object-oriented is a programming method
2. Object-oriented is a way of thinking
3. Object-oriented is not a programming language
How should you learn to object-oriented
1. Mastering an object-oriented language syntax
2. Mastering the object-oriented way of thinking
3. Familiarity with object-oriented design principles
4. Mastering object-oriented design patterns
What is an object-oriented thinking method?
1. First determine who will do, and then determine how to do;
2. First consider the whole, secondly consider the partial;
3. First of all, consider the abstract, followed by specific
Summarize
1. Don't assume that mastering an object-oriented language is about mastering object-oriented
2. Habits and the comparison between the object-oriented and the real world;
Object-oriented Design the ultimate goal is to reduce duplication of code
Object Oriented (ii)
1. Methods for creating classes
Class name
{
Properties
Method
}
Properties are also called member variables, which are used primarily to describe the state of a class
Methods are also called member methods, which are used primarily to describe the behavior of a class
How to represent a class
Methods for defining classes
2. Ways to create objects
3. References to Objects and objects
Relationship of classes and objects
Java Object-oriented