Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why is the problem with this logic ?

 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"


  •  
    fred rosenberger
    lowercase baba
    Bartender
    Pie
    Posts: 12097
    30
    Chrome Java Linux
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic