Java Datatypes

  • + 0 comments

    It's to do with the range that data type can have.

    For example short can have minimum -32,768 to maximum of 32,767.

    Same case for int & long, which is ONE less number for it's maximum.

    It's easier to write (2^31 - 1) than it is to write 2147483648 - 1 = 2147483647