Is there any sizeof-like method in Java?

后端 未结 15 1079
暗喜
暗喜 2020-11-27 15:03

Is there any built-in method in Java to find the size of any datatype? Is there any way to find size?

15条回答
  •  半阙折子戏
    2020-11-27 15:53

    I don't think it is in the java API. but most datatypes which have a number of elements in it, have a size() method. I think you can easily write a function to check for size yourself?

提交回复
热议问题