This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Cattle Drive and the fly likes Help Java 4b ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Help Java 4b ???" Watch "Help Java 4b ???" New topic

Help Java 4b ???

Andy Boyd

Joined: Feb 02, 2004
Posts: 5
I am stuck on this and need some help. I am having difficulty breaking up the large number into something that I can use. I took my assignment from 4a and converted it to work with numbers up to 999, and made that into a method that I can call. What I need to figure out is the best way to break up the number 999,999,999,999 into 3 digit pieces. I don't know if I should use sub-strings and then parse the integers from those strings or use some math to divide this number up. Any help or insight would be greatly appreciated. Thanks
Pauline McNamara

Joined: Jan 19, 2001
Posts: 4012
Decisions decisions! I think you might do ok with either one of those approaches. There isn't one correct answer only. Is that what you were asking?
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9056
I think I would go with the math because it is simpler, but either way can be acceptable, depending on how it is implemented.

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
I agree. Here's the link:
subject: Help Java 4b ???
It's not a secret anymore!