View Single Post
  #2 (permalink)  
Old 07-24-2007, 02:14 PM
shanePreater shanePreater is offline
Member
 
Join Date: Jul 2007
Location: England, Bath
Posts: 47
shanePreater is on a distinguished road
Step 1 is quite straight forward. You can use the parseInt function on the Integer class:
Code:
int number = Integer.parseInt(someString);
Remember to check for NumberFormatExceptions if the user types in rubbish.
The next bit of making the 1 mean small can be as simple as defining a constant in your class but you may want to investigate using an enum instead.

Hope this helps.
__________________
Shane Preater -
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote