Frage im Vorstellungsgespräch bei Infosys

String str1="abc"; String str2="abc"; String str3=new String ("abc"); String str4=str1; How many memory allocation will be there.

Antworten zu Vorstellungsgespräch

Anonym

10. Sep. 2018

Explained, (heap memory alloc and string pool mem)

3

Anonym

22. März 2021

Total 2 one in heap and one in string pool