Parameters in. NET

Source: Internet
Author: User

: CLR allows methods to be overloaded based on whether the out or ref parameters are used. However, if the two overload methods only have the difference between out and ref, it is invalid because the metadata representation of the two signatures is identical.

: When a variable number of parameters is called, some additional performance loss will occur (unless null is explicitly passed), because the array object must be allocated on the stack and the array element must be initialized, in addition, the Array Memory must eventually be garbage collected. To reduce performance loss, consider defining several overloaded versions that do not use the params keyword. See the Concat method of the System. String class.

Related Article

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.