This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

Help with simple String?

Peter Hammar
Ranch Hand

Joined: Mar 01, 2010
Posts: 34

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)...


David Newton

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

Have you checked out Aspose?
subject: Help with simple String?
jQuery in Action, 3rd edition