📜 ⬆️ ⬇️

Value Types in Java

Duke
This post is a free translation of the State of the Values document, suggestions for introducing value types into the JVM, and the Java language itself written by John Rose, Brian Goetz, and Guy Steele, diluted with my thoughts. The details of the proposal for the implementation of value types at the level of bytecode are omitted, which is not very interesting for most Java programmers.



The most important thought: an object (reference) identity is needed only to support the variability of objects. An object can change its state, but by reference we can always verify that it is “the same” object. Therefore, the value types will be strictly immutable.

Suggested uses of value types:

')

Source: https://habr.com/ru/post/222113/


All Articles