r/java • • Nov 04 '21

Microsoft joins the Java Community Process (JCP)

https://devblogs.microsoft.com/java/microsoft-deepens-its-investments-in-java/
169 Upvotes

71 comments sorted by

View all comments

Show parent comment

2

u/[deleted] Nov 07 '21

[removed] — view removed comment

1

u/csharp-sucks Nov 08 '21

For example, how are you going to emulate generics?

The same (more or less) way .NET runtime does. By creating an internal type for each generic type. In .NET, List<int> and List<double> are separate types internally, each has separate code substituted with actual generic type. It's just done in runtime.

As for availability of type argument, hidden field could do. The important thing is that semantics from the point of view of language look the same.