jeudi 17 septembre 2015

Modify strings with reflection

I was reading this question/answers, which basically showed an interesting behaviour in Java and strings, and two questions came up in my mind:

  1. Are Objective-C/Swift String s behave the same? I mean if I have for example two variables which stores the same literal "someString", internally, will they refer to one "someString" object? I didn't find anything about it in the documentation.
  2. If the answer to my previous question is yes, then is it possible to change same string literals the way like in Java?




Aucun commentaire:

Enregistrer un commentaire