tinoymalayil 0 Report post Posted July 14, 2012 Please tell me what is the advantage of using generic collection in c#.We can use the normal collection class like List myList =new List().and the generic collection List<string> myList=new List<String>(). Could you please reply how the working of the generic ollection class? Share this post Link to post Share on other sites
Ananya 0 Report post Posted July 14, 2012 I have used collection framework in Java.Where it works exactly the way you have mentioned here.What I understand about collection is- it is a way to put objects/wrapper classes intodifferent data structures like array,arraylists, vectors, Maps e.t.c.List myList =new List().- > is a list where one can add objects of data type Integer,Float,Double, String or anything else.But List<string> myList=new List<String>() is a generic one wherein one can add an object of only String type.But it has to be kept in mind that this type information is maintained onlyduring compilation and not on runtime.During runtime a type erasure works that deletes the type information during runtime. Share this post Link to post Share on other sites