4
Answers

Generic Methods

Avuya Mxoli

Avuya Mxoli

12y
2.9k
1
Hi All,

I just started learning generics and we were asked to create a generic method in a class that accepts an array and an individual object of the same type. The method should remove duplicates in the array and replace the duplicate with a with a default or elimination value represented by the second parameter. We then have to create an application that will implement this using 3 different types that have different lengths.
I've seen many ways of doing this but since I am still very new at this I don't know which one to apply to my problem. Any help will be appreciated. 

Answers (4)