I have mostly used generics to make type safe collections.What are the other uses of generics?
I have mostly used generics to make type safe collections.What are the other uses
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To allow user-created, custom classes to be used with your code.
Say you release an SDK that enables some kind of special functionality. Generics will allow developers to utilise your functionality in many places, with almost any class.
The purpose of generics to reduce code repetition.