Is there something known as Array type mismatch exception in C#?
问题 My teacher has asked me to write a program in C# to handle "Array type mismatch exception". But i couldn't find anything in the net related to that. I just want to confirm if there exists something like that. 回答1: ArrayTypeMismatchException on MSDN 回答2: Let’s say Class2 derives from Class1, because C# language is covariant when it comes to assigning arrays following assignment is perfectly valid Class1[] generalizedArray; Class2[] specializedArray = new Class2[]{new Class2(),new Class2()};