Go Back   WinkeyFinder Forums > Editorial Reviews Articles > Technology Articles

Technology Articles Latest Technology articles

Reply
 
Thread Tools Display Modes
  #1  
Old 01-27-2010, 08:09 PM
Junior Member
 
Join Date: Jan 2010
Posts: 1
Rep Power: 0
midni6htf4iry is on a distinguished road
Java - Need help tokenizing and parsing String to Int..?

I need to write a segment that will take a String sequence, such as "25 3 62 19", and push each integer to a stack so I can then get an output of "19 62 3 25".I am assuming a good way to do this would be to tokenize the string with a whitespace delimiter and the parse the tokens to integers so I can push each int into the stack.. or vice versa... I know the methods that I should use to do this operation but I am getting confused on how to write the code for it.This is pretty much all I have gotten so far.. and this is only tokenizing the string.. help! Thank youArrayList tokens = new ArrayList();Scanner tokenize = new Scanner(userInput);while (tokenize.hasNext()) { tokens.add(tokenize.next());}
__________________
Powered by Yahoo!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT. The time now is 12:55 PM.


WinkeyFinder License Agreement
WinKeyFinder - Tips and Tricks - Vista News - Downloads - Support - FAQ - Site Home - Win Keyfinder 1.73 RC2 - Simple KeyFinder - Windows Vista Cd Key Finder - DigitalSEO - Got jobs - Freshers job listing
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
WinkeyFinder Reserves all copyrights related to WinkeyFinder, All Other Logos and Banners used in this website are trade marks of their respective owners. and Subject to copyrights!
All trademarks mentioned on this page are the property of their respective owners.