Content deleted Content added
m Add inline citation. Add link to JVM. |
Remove duplicate references, use {{rp}} instead. |
||
Line 377:
{{Main article|Generics in Java}}
Support for the ''generics'', or "containers-of-type-T" was added to the [[Java (programming language)|Java programming language]] in 2004 as part of J2SE 5.0. In Java, generics are only checked at compile time for type correctness. The generic type information is then removed via a process called [[type erasure]], to maintain compatibility with old [[Java virtual machine|JVM]] implementations, making it unavailable at runtime.<ref name=Bloch>
====Genericity in .NET [C#, VB.NET]====
Generics were added as part of [[.NET Framework#.NET Framework 2.0|.NET Framework 2.0]] in November 2005, based on a research prototype from Microsoft Research started in 1999.<ref>[https://docs.microsoft.com/en-us/archive/blogs/dsyme/netc-generics-history-some-photos-from-feb-1999 .NET/C# Generics History: Some Photos From Feb 1999]</ref> Although similar to generics in Java, .NET generics do not apply [[type erasure]]<ref name=Albahari>{{cite book |last=Albahari |first=Joseph |title= C# 10 in a Nutshell |publisher= O'Reilly
.NET allows six varieties of generic type constraints using the <code>where</code> keyword including restricting generic types to be value types, to be classes, to have constructors, and to implement interfaces.<ref>[https://msdn2.microsoft.com/en-us/library/d5x73970.aspx Constraints on Type Parameters (C# Programming Guide)]</ref> Below is an example with an interface constraint:
Line 692:
== Sources ==
{{refbegin}}
* {{cite book |last=Albahari |first=Joseph |title= C# 10 in a Nutshell |publisher= O'Reilly
* {{Cite book | last1 = Musser | first1 = D. R. | author-link1 = David Musser | last2 = Stepanov | first2 = A. A. | author-link2 = Alexander Stepanov| chapter = Generic programming | doi = 10.1007/3-540-51084-2_2 | title = Symbolic and Algebraic Computation: International symposium ISSAC 1988 | editor = P. Gianni | editor-link = Patrizia Gianni | series = Lecture Notes in Computer Science | volume = 358 | pages = 13–25 | year = 1989 | isbn = 978-3-540-51084-0 }}
* {{cite conference | url =https://www.research.att.com/~bs/hopl-almost-final.pdf |title=Evolving a language in and for the real world: C++ 1991-2006 |author-link=Bjarne Stroustrup |last=Stroustrup |first=Bjarne |conference=ACM HOPL 2007 |year=2007}}
|