Hacker News new | ask | show | jobs
by _old_dude_ 1032 days ago
In C#, value types and reference types are two separate kind of types, value types are pass by copy (like C structs) and generics where clauses have coloring (struct constraints [1]).

In Java, value types are immutable so the VM can pass by value or by copy, as a user you don't see the difference and there are backward compatible (per the article), you don't need to recompile the user code when you replace an existing class by a value class.

C# has value types since the beginning so primitive types are value types while in Java it seems there will be 3 kinds of types instead of 2.

[1] https://learn.microsoft.com/en-us/dotnet/csharp/programming-...