java - How Or why is there a limit on any primitive data types -


in java like, short range -32768 32767, while int, -2147483648 2147483647. looks designers created different sized buckets store range values.then have created bunch of more data types of different ranges, boiled down 8 types these ranges. reasons?

instead of exposing data structure (or 2 1 number other chars) can store user defined dataset have worked.

byte 1 byte, short 2 bytes, int 4 bytes, , long 8 bytes. other data types storing other types of data. numbers mentioned largest , smallest signed integers can fit within one, two, four, , 8 bytes respectively. (and 1, 2, 4, , 8 powers of two.)


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -