+ 2
Tell me how to print size of Boolean in Java?
how can we print size of Boolean programatically in Java?
4 Antworten
+ 2
can U tell me how to write it programatically?
+ 2
https://www.quora.com/How-do-we-calculate-the-size-of-the-object-in-Java
https://www.mkyong.com/java/how-to-add-your-manifest-into-a-jar-file/
Here you have a pretty clear explanation, how it works. Hope this helps. Tomorrow if I have enough time, I can try to do it, in case it will still cause problems for you.
Unfortunately, Java does not provide sizeof method for this purpose like C/C++ do. :/
+ 2
thanks , it was very useful👍
+ 1
java.lang.instrumentation class provides methods to get the size of an object in Java.