Chapter 17: Problem 7
Is it possible to create an instance of a generic class without providing a type argument? If so, is this recommended?
Short Answer
Expert verified
Answer: It is possible to create an instance of a generic class without explicitly providing a type argument (e.g., using 'var' in C#), but a concrete type must be provided at some point in the code, like when instantiating the class. However, it is generally not recommended, as generics are designed to provide type safety and code reusability by working on multiple data types. Not providing a type argument may lead to type ambiguity or errors.