First, why the need for object-oriented:
Before object-oriented, structured programming is the mainstream of program design, which is called "process-oriented" programming.
A process-oriented approach to development typically has the following issues:
1. Poor reusability of software
2. Poor maintainability of software
3. Poor software flexibility
Object in object-oriented programming is a data structure with state (attribute) and behavior (method), which is used to describe something in the real world and model things in the real world.
Ii. the relationship between objects and classes:
Class: An abstract definition of a thing;
Object: An objective concrete thing.
2.1. Creating classes and objects
declaration class: class className//< category name >
{
fields< fields >
methods< methods >
properties< Properties >
}
created object:className object=new Constructor (parameter list);
Class Name Object name construction method ()
C # Object-oriented