Content deleted Content added
Line 53:
:::: Microsoft documentation says: "Boxing operations occur when you pass a value type to a method that takes a System.Object as an input parameter."[http://msdn.microsoft.com/en-us/library/ms173104.aspx]. Which is the case for List.[http://msdn.microsoft.com/en-us/library/3wcytfd1.aspx]. There is a lot of syntactic sugar in C#. [[User:Hervegirod|Hervegirod]] ([[User talk:Hervegirod|talk]]) 12:39, 15 January 2012 (UTC)
:::::This thread is more than six months old, so I wouldn't expect much response. However, the documentation you linked says "..takes a ''System.Object'' as..". Generic list does not take System.Object as input parameter, indeed, the lack of boxing is one the main reasons for generics to exist and why generic collections are faster than their nongeneric counterparts. List<T> differs from ArrayList (which inherits from IList interface) by strong typing of the collection objects. --[[User:Sander_S%C3%A4de|<span style="font-family:Courier; color:#555">Sander Säde</span>]] 12:59, 15 January 2012 (UTC)
:::::As [[User:Sander_S%C3%A4de|<span style="font-family:Courier; color:#555">Sander Säde</span>]] says, you are linking to the ''non-generic'' version (comparable to a "raw" type in java). C# has generic versions of collections and in there you will find a List<T> as was demonstrated to you in the example above. Repeat: Value types are first-class citizens and unlike in Java '''no boxing''' is performed when stored in a generic collection of the same type. It has to do with the fact that C# has reified generics and does not erase the type of generics parameters.--[[User:Useerup|Useerup]] ([[User talk:Useerup|talk]]) 16:52, 16 January 2012 (UTC)
== I think you're missing the point... ==
|