Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help with this String Thing

 
Rebecca Herbert
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 1685
22
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rebecca Herbert
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are awesome. Thanks so much for the quick effective response.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic