Will structs and value types (like C#'s) be included in Java 7?
5 Answers
Here is John Rose's (an Oracle JVM developer) blog post about this proposal. It has been around for a while, but not as an official JSR. It seems unlikely to happen even in java 9.

- 5,496
- 37
- 56
-
Java Value Types are part of Project Valhalla which is planned for Java 10. – clay Feb 15 '15 at 21:53
As posted elsewhere, from JDK architect John Rose
http://cr.openjdk.java.net/~jrose/values/values-0.html
This is part of Project Valhalla (http://openjdk.java.net/projects/valhalla/) and is planned for Java 10.

- 18,138
- 28
- 107
- 192
-
If the Framework can support arrays of value types, is it better for boxed value type `T` to have the members of `T`, or for it to have a member `value` of type `T`? Although .NET takes the former approach, I think in many ways the latter would be cleaner (I dislike autoboxing, and dislike auto-unboxing even more). – supercat Jul 08 '14 at 18:27
Not that I've seen in any proposals - and I'm pretty sure we'd have heard about it by now.
Note that this would be a very significant JVM change, rather than just a language change as many of the existing proposals are.

- 1,421,763
- 867
- 9,128
- 9,194
It's not listed among the features expected according to the Java Wikipedia page. It would also require a very large (and almost certainly breaking) change in the JVM.

- 101,701
- 37
- 181
- 258
that's actually not the best thing from c# which you can borrow, I think that stuff like
var x = 1;
list.Select(o => o.Something = true) lambda expressions
and some stuff from as or javascript like:
o = new Object();
o.MyNewProp = 5
o.Do = new Function(){}
would be much better

- 69,856
- 92
- 277
- 407
-
1please no!.... lambda expressions are just syntactic sugar for some form of function object. saving typing at the expense of adding complexity to the Java language syntax is a net loss IMO. the Javascript dynamic stuff is nice, but kills performance because it cannot be statically compiled - so it belongs on a dynamic language for the JVM (e.g. Groovy, Clojure, JRuby), not Java itself – mikera May 13 '11 at 13:13