Does Java make distinction between value type and reference type

后端 未结 3 1388
灰色年华
灰色年华 2020-12-10 11:04

C# makes distinction of those two. Does java do the same or differently?

3条回答
  •  没有蜡笔的小新
    2020-12-10 11:40

    In Java, all objects and enums are reference types, and all primitives are value types. The distinction between the two is the same as in C# with respect to copy semantics, but you cannot define a new value type in Java.

提交回复
热议问题