Talk:Comparison of C Sharp and Java: Difference between revisions

Content deleted Content added
SineBot (talk | contribs)
m Signing comment by 193.8.222.12 - "Value types: "
Line 54:
:::::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&nbsp;Säde</span>]] 12:59, 15 January 2012 (UTC)
:::::As [[User:Sander_S%C3%A4de|<span style="font-family:Courier; color:#555">Sander&nbsp;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)
::::Trying to implement a Complex type in C# is a good exemple of what C# can do with value types and operator overloading (kind of new primitive types). It is impossible in Java. <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/193.8.222.12|193.8.222.12]] ([[User talk:193.8.222.12|talk]]) 10:53, 17 January 2012 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
 
== I think you're missing the point... ==