Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with simple String?

 
Peter Hammar
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

First time poster here!

This is the code:

Im doing a very simple math program. It takes two int values and adds them together in a method (not shown above). But when I get the question if I want to continue, no matter what I write, I always get the "Good Bye!"...whats missing? I know it has something to do with the String, as I have tested this using INT (I do have a while loop)...

Anyone?

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because you don't compare strings with "==", but with .equals.

Welcome to JavaRanch!
 
Peter Hammar
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that helped alot!
 
Sherif Shehab
Ranch Hand
Posts: 485
Android Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter for more informations read this POST
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic