We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
long 64 –9,223,372,036,854,775,808 to
9 ,223,372,036,854,775,807
int 32 –2,147,483,648 to
2,147,483,647
short 16 –32,768 to
32,767
byte 8 –128 to
127
if you recognize the positive number of the primitive variable is alway less with 1, check the Byte the minimum is -128 and the positive is not 128, its 128 -1 = 127, so we add -1 so we can have the right positive range and have the right value.
wish i was helpfull
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Datatypes
You are viewing a single comment's thread. Return to all comments →
long 64 –9,223,372,036,854,775,808 to 9 ,223,372,036,854,775,807
int 32 –2,147,483,648 to 2,147,483,647
short 16 –32,768 to 32,767
byte 8 –128 to 127