Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

number too large

Tags:

java

Hey , i hope i get help with this.

im a coder of a rsps (runescape private server)

and in this game you could like have items and weapons

and the max anmount of a item you can have is 2147000000

and i can change the amount of the max by changing this int

public int maxItemAmount = 2147000000;

and it works

but i want to make it like 3000000000

and i do this

public int maxItemAmount = 3000000000;

and when i compile i get this error

integrer number too large: 3000000000

please guys help me out if you can :)

like image 397
abdullah Avatar asked Mar 05 '26 17:03

abdullah


1 Answers

Integer has an upper bound of 2^31 (2147483648). If you want numbers longer than that, you can use a long or double.

like image 131
Jeff Storey Avatar answered Mar 08 '26 05:03

Jeff Storey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!