public class C {}
public struct S : C {}
public class Test
{
public static void Main() {}
}
This doesn't compile. Every struct implicitly inherits from the class ValueType
, which inherits from the class object
. How is this possible?
A Structure is a type of value, not a class. Structures cannot inherit from another class or structure. You should consider reading the documentation about structures here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.