Home arrow static arrow Java Programming [Archive] - Whats the largest number an int can hold?
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Whats the largest number an int can hold?
This topic has 2 replies on 1 page.

Posts:147
Registered: 8/12/03
Whats the largest number an int can hold?  
Jul 18, 2004 10:04 AM



 
Whats the largest number an int can hold?

I am going back and forth on using BigInteger or int.. I am not 100% sure whats the largest number an int can hold. .can anyone help me.. Thanks!
 

Posts:173
Registered: 3/6/00
Biggest int  
Jul 18, 2004 10:06 AM (reply 1 of 2)



 
java.lang.Integer.MAX_VALUE == 2^31 - 1.
 

Posts:24,036
Registered: 2/3/03
Re: Whats the largest number an int can hold?  
Jul 18, 2004 10:24 AM (reply 2 of 2)



 
It's an extremely important skill to learn to read the API and become familiar with the tools you will use to program Java. Java has an extensive set of [url=http://java.sun.com/reference/api/index.html]documentation[/url] that you can even [url=http://java.sun.com/docs/index.html]download[/url] for your convenience. These "javadocs" are indexed and categorized so you can quickly look up any class or method. Take the time to consult this resource whenever you have a question - you'll find they typically contain very detailed descriptions and possibly some code examples.

http://java.sun.com/reference/api/index.html
http://java.sun.com/j2se/1.4.2/docs/api/
 
This topic has 2 replies on 1 page.