+ 1
Why increase the size for integer in java??
3 Antworten
+ 1
if you write into a
the size is same but when you write
integer (int) a
the size will increase
0
didn't get your questions? can you explain it ?
0
you can't, only if you define your integer unsigned then you can essentially have an integer bigger in size however the reverse is true, you can downcast an int to a smaller value I.e a short but with any sort of casting you run the risk if losing data or precision and therefore all casting should be handled in a try/catch block