This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help with simple String? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with simple String?" Watch "Help with simple String?" New topic
Author

Help with simple String?

Peter Hammar
Ranch Hand

Joined: Mar 01, 2010
Posts: 34
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

Joined: Sep 29, 2008
Posts: 12617

Because you don't compare strings with "==", but with .equals.

Welcome to JavaRanch!
Peter Hammar
Ranch Hand

Joined: Mar 01, 2010
Posts: 34
Thanks, that helped alot!
Sherif Shehab
Ranch Hand

Joined: Mar 05, 2007
Posts: 483

Peter for more informations read this POST


Thanks,
Sherif
 
 
subject: Help with simple String?