aspose file tools*
The moose likes Java in General and the fly likes Sacnner Issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sacnner Issues" Watch "Sacnner Issues" New topic
Author

Sacnner Issues

Ishan Pandya
Ranch Hand

Joined: Feb 06, 2012
Posts: 223

Hiee everyone..!!
I am using Scanner Class for separating the tokens.
Here is the code.



I want the Integer value from the String defined in the class. But i am not getting any output (i.e the output is blank and I am expecting 101 as output).


OCPJP
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

You need to be aware of the fact that a token is a single word ( without space delimiters ) .



Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Ishan Pandya
Ranch Hand

Joined: Feb 06, 2012
Posts: 223

Saif Asif wrote:You need to be aware of the fact that a token is a single word ( without space delimiters ) .


So you mean I have to use StringTokenizer instead of Scanner?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
No. You should not use string tokenizer at all. If that is the input, you will need to change the delimiter on your Scanner.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sacnner Issues