Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Comparison of C Sharp and Java
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Migration compatibility === Java's type erasure design was motivated by a design requirement to achieve ''migration compatibility'' β not to be confused with [[backward compatibility]]. In particular, the original requirement was "''β¦ there should be a clean, demonstrable migration path for the Collections APIs that were introduced in the Java 2 platform''".<ref name="Jcp.org"/> This was designed so that any new generic collections should be passable to methods that expected one of the pre-existing collection classes.<ref>{{cite web |author=Neal Gafter |url=http://gafter.blogspot.com/2004/09/puzzling-through-erasure-answer.html |title=Neal Gafter's blog: Puzzling Through Erasure: answer section |publisher=Gafter.blogspot.com |date=23 September 2004 |access-date=18 August 2013}}</ref> C# generics were introduced into the language while preserving full backward compatibility, but did not preserve full ''migration compatibility'': Old code (pre C# 2.0) runs unchanged on the new generics-aware runtime without recompilation. As for ''migration compatibility'', new generic collection classes and interfaces were developed that supplemented the non-generic .NET 1.x collections rather than replacing them. In addition to generic collection interfaces, the new generic collection classes implement the non-generic collection interfaces where possible. This prevents the use of new generic collections with pre-existing (non-generic aware) methods, if those methods are coded to use the collection ''classes''.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)