Given the following structure declared:
 
struct MyStruct 
{ 
      public int x; 
      public int y; 
}
 
Is the following code correct?
 
class MyClass : MyStruct
 {
 }
 
Explanation
No, it's impossible to inherit from a structure. All structures are implicitly sealed

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты