MCQs>IT & Programming>C#>The where condition for the generic definition should be changed to ensure that the code will compile. class MyClass<V> where V :class, IComparable { public void foo() { V aClass = new V(); } } class Program { public static void Main(string[] args) { } } How should the where condition be changed?
C# MCQs
The where condition for the generic definition should be changed to ensure that the code will compile. class MyClass<V> where V :class, IComparable { public void foo() { V aClass = new V(); } } class Program { public static void Main(string[] args) { } } How should the where condition be changed?
Answer
Correct Answer: Add "new()" as the last generic where condition
Explanation:
Note: This Question is unanswered, help us to find answer for this one