Overload functions in C #

Source: Internet
Author: User

I read a book a few days ago and saw that in C #, I checked whether two functions in a class are heavy-duty functions. The type of Return Value of the function is not a required condition, this is not the same as C and C ++.

According to the current summary, the following conditions are met for function overloading in C:

1. The function name is the same

2. The number of function parameters is different, or the parameter type is different.

In C #, if public string show (string S) and Public void show (string s) are defined in the same class, the compiler reports an error, they are not considered as overload functions!

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.