C Sharp (C#) - CollectionsWhich collection type can be initialized using collection initialization syntax in C#?AAny collection implementing ICollection<T>BOnly Dictionary<TKey, TValue> typesCOnly List<T> typesDOnly arraysCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify collection interfaceCollection initialization works with any collection that implements ICollection<T>.Step 2: Evaluate optionsAny collection implementing ICollection<T> correctly states this general rule, while others limit to specific types.Final Answer:Any collection implementing ICollection<T> -> Option AQuick Check:Collection initialization works with ICollection<T> collections [OK]Quick Trick: Collection initialization requires ICollection implementation [OK]Common Mistakes:MISTAKESAssuming only List or Dictionary support initializationThinking arrays are the only supported collections
Master "Collections" in C Sharp (C#)9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More C Sharp (C#) Quizzes Classes and Objects - Object instantiation with new - Quiz 8hard Classes and Objects - Constructor overloading - Quiz 3easy Exception Handling - Why exception handling is needed - Quiz 12easy File IO - Why file operations matter - Quiz 2easy File IO - File paths and Directory operations - Quiz 3easy File IO - Using statement with file streams - Quiz 12easy Inheritance - Why inheritance is needed - Quiz 4medium Interfaces - Interface vs abstract class decision - Quiz 8hard Interfaces - Implementing interfaces - Quiz 6medium Properties and Encapsulation - Read-only and write-only properties - Quiz 7medium