wood burning stoves 2.0*
The moose likes Java in General and the fly likes Problem using StringTokenizer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem using StringTokenizer" Watch "Problem using StringTokenizer" New topic

Problem using StringTokenizer

Ankur Premi

Joined: Aug 07, 2010
Posts: 17
I am trying to use StringTokenizer for saving the value of val (See code below) in different variables.

I have written this code. But this code is returning null values. It's not saving the value of val corresponding to the key.

Please help me.
Vinoth Kumar Kannan
Ranch Hand

Joined: Aug 19, 2009
Posts: 276

I suppose, it wont even enter the three if statements. How did you decide it gives null values?
Use equals() to compare the contents of 2 strings.'==' is used to check reference equality.

Ankur Premi

Joined: Aug 07, 2010
Posts: 17
thank you vinoth. it worked
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 36478
Ankur Premi wrote:I am trying to use StringTokenizer . . .
Why? It is a legacy class.
I agree. Here's the link: http://aspose.com/file-tools
subject: Problem using StringTokenizer
Similar Threads
File Operations Program Problem
please help with tokenizing
Tokenizing after reading from a file
How to search a Vector array?
exercise getServiceByName