Re-learning "C # Advanced Programming" (Objects and types)

Source: Internet
Author: User

Yesterday, I looked at the "C # Advanced Programming" in the object and type chapter, found that there are many omissions do not understand the place to re-understand

First of all, what is the object, my personal feeling is: in the programming world, a program is the processing logic of a thing, and the object is the abstract concept of this logic.

For example: We want to write a program to achieve "a person to drink water", according to my custom, here can be divided into two objects

1, "Person" object: This person can be Zhang San, John Doe, can even be an animal

2, "Water" object: This water is also a conceptualization of things, ice water, whitewater, wine, drinks are OK

  

A class is an object, a class can have data members and function members, and data members include: Fields, constants, and members of events

For the "People" Object above, field: height, weight, gender, age ...

Constant: Limbs (this should be a constant, I really can't find what can be used as a constant in the person)

Function members include: Methods and properties

A method is something that an object can handle: People can drink water, people can wear clothes ...

A property should be a special function, a function specifically designed to take values and assign values to a field.

        

          

Re-learning "C # Advanced Programming" (Objects and types)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.