Asp.net (c #) is not accessible because it is restricted by the protection level.

Source: Internet
Author: User

The error occurred when I wrote a plural class today. The original code is simplified as follows:

Public class complex
{
// Constructor
Complex (double r, double I)
{
Complex_real = r;
Complex_imagin = I;
}
}

I am very depressed here. It's okay to write JAVA like this, but c # has a lot of requirements for this. In some cases, it must be declared as public, but this error occurs, it is generally caused by modifier errors. For example, you should have used public, but you have used private or nothing to write:

Private is a private variable.
Public is a common variable.
The modified code is as follows:

Public class complex
{
// Constructor
Public complex (double r, double I)
{
Complex_real = r;
Complex_imagin = I;
}
}

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.