2080 11

CSC378 ยท 2080 ยท 5 marks

Differentiate between generic and non-generic collections. Write a simple program to create generic class with generic constructor, generic member variable, generic property and generic method.

Differentiate between generic and non-generic collections. Write a simple program to create generic class with generic constructor, generic member variable, generic property and generic method. [5]

NET Centric ComputingChapter 1: Language PreliminariesGenerics

Feature Generic Collection Non-Generic Collection --------- Namespace System.Collections.Generic System.Collections Type Safety Type-safe at compile time Not type-safe (stores object) Boxing/Unboxing No boxing/unboxing needed Requires boxing/unboxing for value types Performance Better performance...