my dog learned polymorphism
The moose likes Cattle Drive and the fly likes 4b and the integer limit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "4b and the integer limit" Watch "4b and the integer limit" New topic

4b and the integer limit

Steven Lacher

Joined: Dec 26, 2002
Posts: 12
My issue is that this all works fine - except for numbers over the 2,147,483,647 ceiling, which throw an error.

I'd like to use longs instead, but I'm not quite sure how to do it, and have the array-element selecting code still work.

SCJP 1.4
Brian Holsenbeck

Joined: Jul 01, 2008
Posts: 8
I'm currently on this, and being nitpicked. Take a look at the Long wrapper class - you can handle the numbers we are dealing with using that.
Katrina Owen

Joined: Nov 03, 2006
Posts: 1367
are you familiar with casting?

That would take care of the array problem you are having, I think.
I agree. Here's the link:
subject: 4b and the integer limit
It's not a secret anymore!