Integer as primitive type

前端 未结 4 527
不知归路
不知归路 2020-12-19 04:45

Why there is primitive type for integer(int) even though we have an object for integer as Integer? But the same is not with String type. There is no such primitive type for

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-19 05:30

    A string datatype is considerably more complex than an int - there's a variable amount of memory to hold a string for one thing.

提交回复
热议问题