How many String objects will be created when using a plus sign?

后端 未结 6 1968
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 18:07

How many String objects will be created when using a plus sign in the below code?

String result = \"1\" + \"2\" + \"3\" + \"4\";

If it was

6条回答
  •  萌比男神i
    2020-11-30 18:29

    I doubt this is mandated by any standard or spec. One version can likely do something different from another.

提交回复
热议问题