• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with if statements and || operator  RSS feed

 
Olof Sturesson
Greenhorn
Posts: 9
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys! A noob need help! (And a new user to this forum, so not sure if i posted in the right place :p )

Why isn't this method working? The user is supposed to type their gender by pressing B or G buttom. But.. What ever i'm pressing when testing the program the results are always the same, that is - the last else statement block always prints out (yea, even if i press B,b,g or G...). What's wrong with my code?


Thanks in advance!
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest you read this FAQ.
 
Olof Sturesson
Greenhorn
Posts: 9
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.equal()

Forgot, thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!