C # review:
Problem:
Add 5 Student information to the collection,
Each student has: study number, name, score, 3 content,
The students ' scores are arranged from high to low and printed out after the completion of the addition.
Object Oriented thinking:
All things are objects
Object-oriented three major features:
Package: Package equivalent to the protection of the constraints, the stars are economic people, to see the star must first go through the broker's review.
Inheritance: Objects are hierarchically arranged, the next level can inherit the previous urgent attribute, but the upper level can choose to reject the next level of inheritance.
Polymorphism: The same attribute on the previous level, different next-level usage, such as white roses, can be sent to a lover, can also be sent to the hospital to visit the patient.
Classes class:-------------------------------------------
Package: Package equivalent to the protection of the constraints, the stars are economic people, to see the star must first go through the broker's review.
Member variables: member variables are equivalent to stars. Private string _mingxing
Properties: The encapsulated content is called an attribute, and the property is equivalent to a broker. Private string mingxing
Member method: A star can have multiple brokers, a broker can serve multiple stars, do not correspond to stars, a broker can manipulate multiple star values, or it can be read-only.
Constructor: Default hidden, need to walk a method instantiation display, teacher t=new teacher
6.17 outline of object-oriented ideas and classes