This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help with this String Thing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help with this String Thing" Watch "Help with this String Thing" New topic

Help with this String Thing

Rebecca Herbert

Joined: Feb 01, 2012
Posts: 3
I am on a team that has to write programs for class, and we are stuck with an issue with this code. When we put in a value, it doesn't print anything. Any ideas what the problem is?

Any help is appreciated.
Carey Brown
Ranch Hand

Joined: Nov 19, 2001
Posts: 893

Try .equals() instead of ==. The former compares the contents of two objects, the later compares the two object references to see if they refer to the same object.

Understanding the scope of the problem is the first step on the path to true panic
Rebecca Herbert

Joined: Feb 01, 2012
Posts: 3
You are awesome. Thanks so much for the quick effective response.
Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

Hi, and welcome to the Ranch!

Here are a couple of tips to make your time here more productive and rewarding.

1. When posting code, please UseCodeTags(←click) to make it more readable. I've added them to your initial post for you.

2. Please KeepItDown(←click). An abundance of exclamation marks seems like shouting, and nobody likes to be shouted at.

Happy coding!
I agree. Here's the link:
subject: Help with this String Thing
It's not a secret anymore!