Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IF Else Error. Why?

 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator





Try1.class







What should be the output for (2) and (3) and why?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
never use '==' evaluation for Strings. Always "value".equals(value)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic