הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
'field': cannot declare instance members in a static class
This error occurs if you declare a non-static member in a class that is declared static. It is not possible to create instances of static classes, so instance variables would not be meaningful. The static keyword should be applied to all members of static classes.
The following sample generates CS0708:
// CS0708.cs
// compile with: /target:library
public static class C
{
int i; // CS0708
static int j; // OK
}
משוב של .NET
.NET הוא פרויקט קוד פתוח. בחר קישור כדי לספק משוב: