Frage im Vorstellungsgespräch bei Goldman Sachs

How to make immutable object

Antworten zu Vorstellungsgespräch

Anonym

16. Dez. 2015

If Java, then you can just declare a String object: e.g String x = "abc"; :)

Anonym

18. Jan. 2016

You define this in class definition. The class should be final, and all the fields should be private and final. So there should be no chance of either modifying the values once assigned, or overriding the methods.