Content deleted Content added
Sander Säde (talk | contribs) →Value types: cmt |
|||
Line 85:
:The purpose of explicit interface implementation in C# is to hide functionality unless an instance is explicitly casted to the interface type, or to stack method or operator implementation that would otherwise clash (such as IList vs. IList<T> member implementation). So co-variant return types in Java is not equivalent. [[User:Dahvyd|Dahvyd]] ([[User talk:Dahvyd|talk]]) 06:28, 15 January 2012 (UTC)
:The table is correct:
:*Implicit/explicit conversions: Perhaps they should be termed ''custom'' implicit and explicit conversions. Java does not allow you to create a new type (class) and define conversions to be used automatically when resolving parameter types (implicit conversions) or custom "casting" logic (explicit conversions). In C# implicit conversions have been used to allow automatic "promotion" from e.g. int to the decimal.
:*Events in Java exist in the BCL, but it is not a ''language feature'' as it is in C# (this WP article is about the ''programming languages''). C# events generate "adders" and "removers" automatically much like automatic properties.
:*Rectangular arrays: No, Java does ''definitively'' not have those. Both Java and C# have "arrays of arrays" (also called "jagged" arrays), but only C# has rectangular arrays. Their usefulness can be discussed; they have certain advantages (sometimes better performances under random access) and drawbacks (overhead under sequential access) compared to arrays of arrays.
:*Unified arrays/collections: C# allows a "list" view on arrays and the "foreach" loop uses the unified IEnumerable interface which both arrays and collections implement. In Java, arrays and collections have not been unified; rather the "for" loop has been extended to accept both collections and arrays with the "for each" syntax. But they are actually different statements and you cannot pass an array where a list is expected. You can in C#
:Maybe the table needs to be supported by more examples? --[[User:Useerup|Useerup]] ([[User talk:Useerup|talk]]) 16:46, 16 January 2012 (UTC)
|