java - How many String objects will be created here? -


string x = new string("xyz"); string y = "abc";  x = x + y;  

how many string objects created in code?

there @ least 4 objects:

  • the interned string "xyz"
  • the copy of interned "xyz" string
  • the interned string "abc"
  • the result of concatenating 2 strings.

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -