why don't we need suffix on long in java?

后端 未结 3 1190
悲&欢浪女
悲&欢浪女 2021-01-21 19:18

While writing some code I noticed that long(primitive) data type does not need to have the suffix l or L. My code compiles and run fine with this. Can anyone explain the logic B

3条回答
  •  一向
    一向 (楼主)
    2021-01-21 19:59

    Because an int type can automatically be converted to long.

提交回复
热议问题