An immutable object is an object that once is created it can't change its value.
Un obiect imuabil (immutable) este un obiect care odata ce este creat nu isi poate modifica valoarea.
Based on the definition of the immutable object, if you want to implement your own immutable class, it will look like this
Pe baza definitiei unui obiect immutable, daca doriti sa definiti propria clasa immutable (imuabila), aceasta poate arata astfel
Besides String, there is another immutable object, and this is Integer (the class and not the primitive) which has an interesting behavior for values between -128 and 127.
In afara de String, exista si alte obiect imuabile, iar unul dintre acestea este Integer (clasa si nu tipul primitiv), care are un comportament interesant pentru valori intre -128 si 127.
The most known immutable object in Java is String.
Obiectul immutable cel mai cunoscut in Java este String.
Another type of immutable object in Java, is Integer (there are others, like Double, Color, ...).
Un alt tip de obiect immutable in Java, este Integer (exista si altele, cum ar fi Double, Color, ...).
Potentially sensitive or inappropriate content
Examples are used only to help you translate the word or expression searched in various contexts. They are not selected or validated by us and can contain inappropriate terms or ideas. Please report examples to be edited or not to be displayed. Potentially sensitive, inappropriate or colloquial translations are usually marked in red or in orange.