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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem using StringTokenizer" Watch "Problem using StringTokenizer" New topic
Author

Problem using StringTokenizer

Ankur Premi
Greenhorn

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.


OCPJP 6
Ankur Premi
Greenhorn

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

Joined: Oct 13, 2005
Posts: 38509
    
  23
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