• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem to print value after if  RSS feed

 
yessica barria
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


HELLO Wordl,

I have to do a linear search from one array and comparate a name given from user... the problem is that is no showing the message when is found!!!




 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you explain what those two break statemetns are for, you might realize your error.
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've added the "code" tags to your post, so you can see how your code is indented. (You can do that yourself -- please do it in future.)

However the indentation doesn't match your actual code logic, so it's misleading. And I think it's hiding your error. Here's a correctly-indented version:

 
vikram setty
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Moderator action: solution removed]

 
Mansukhdeep Thind
Ranch Hand
Posts: 1163
Eclipse IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff Verdegan wrote:Vikram setty, please keep in mind that this site is NotACodeMill(←click). We prefer to guide people toward figuring out their own solutions, rather than doing their work for them.

Thanks!


And a warm welcome to the ranch.
 
vikram setty
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm... My code would have helped him to understand better.
Nevertheless, thanks for the information!!!
 
Campbell Ritchie
Marshal
Posts: 56529
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It probably will not help somebody understand, actually.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!