More explantion about generics
Hi, So generics is basically lets us to get rid of the need for cast the object to the type we want to in iorder to access his properties? any insights regarding that matter will be appriciated.
Steven Parker186,663 Points
Hi, I got alerted by your tag.
I wouldn't say generics replace casting, but they do eliminate the need to create separate versions for different data types.generics allow the method to conform to the type you need directly, so no conversion is occurring.