Why does the String class not have a parameterless constructor?

前端 未结 8 605
萌比男神i
萌比男神i 2021-01-11 11:07

int and object have a parameterless constructor. Why not string?

8条回答
  •  误落风尘
    2021-01-11 11:27

    Strings are immutable, therefore new String() has no purpose. What would you do with it?

提交回复
热议问题