• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with String input using Scanner  RSS feed

 
Jahangir Alam
Greenhorn
Posts: 15
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please consider the codes:



If I enter A or B or C, always the output is Fail.

Look at the line eleven. If I give a fixed value of let, it works fine. So, I have problems with inputting string.

How can I fixed it?

Actually in CMD command I want to enter a letter A or B or C and want the expected output.

Any help would be great for me!
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jahangir Alam wrote:Any help would be great for me!

AvoidTheEqualityOperator (←click).

Winston
 
Jahangir Alam
Greenhorn
Posts: 15
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a Lot Winston!

 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jahangir Alam wrote:Thanks a Lot Winston!

You're most welcome.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!