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 IF Else Error. Why? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "IF Else Error. Why?" Watch "IF Else Error. Why?" New topic

IF Else Error. Why?

Phillipe Rodrigues
Ranch Hand

Joined: Oct 30, 2007
Posts: 165


What should be the output for (2) and (3) and why?

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

never use '==' evaluation for Strings. Always "value".equals(value)
I agree. Here's the link:
subject: IF Else Error. Why?