This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes why is the problem with this logic ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "why is the problem with this logic ?" Watch "why is the problem with this logic ?" New topic
Author

why is the problem with this logic ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 675

why this code is not working
  • 1 retreiving all the elements from the arraylist
  • 2 i am spliting the string with white spaces and storing it in a array of string
  • 3 and rest you can figure it out ...but what i m excepting is "yes" but i m getting "no"




  • The Only way to learn is ...........do!
    Visit my blog http://inaved-momin.blogspot.com/
    fred rosenberger
    lowercase baba
    Bartender

    Joined: Oct 02, 2003
    Posts: 10043
        
        6

    I'm pretty sure the answer would be obvious if you printed out "str" and "s" just before your If statement.

    It's a pretty standard debugging technique: When your if statement isn't giving you what you expect, check to make sure you are REALLY comparing what you think you are.

    In this case, you are not.


    Never ascribe to malice that which can be adequately explained by stupidity.
     
    I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
     
    subject: why is the problem with this logic ?
     
    Similar Threads
    Difference between ArrayList and LinkedList?
    LinkedList problem
    Problem While Removing Element From List
    How can we search a name with a regex like "%" in a list of values
    Question on casting