Essay C # Advanced Programming (Seventh edition)

Source: Internet
Author: User

I. Objects and Types

  1. Structs and classes differ in how they are stored, how they are accessed (the type of reference that the class stores on the heap), and the structure is the value type stored on the stack (stack).
  • PS: Distinguish between reference types and value types, please recall (two kids with Lollipop on hand) and (two kids grab remote control to watch TV) example
  1. The ref parameter forces the variable to participate in the method by means of a reference pass, and of course the REF keyword is added when calling the method
  2. The Out keyword allows a function to have multiple returns
  3. Some small limitations of the C # method Overload:
    • Two methods cannot be distinguished only on return types
    • Two methods cannot be distinguished only by parameter declaration as ref or out
  4. You can set different access modifiers for the get and set methods of a property
  5. The same constructor can also set different access modifiers
  6. Static constructors, which are executed only once, note that static constructors cannot have access modifiers, and of course a class can have only one static constructor, and static constructors can only access static members

Essay C # Advanced Programming (Seventh edition)

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.