• Post Reply Bookmark Topic Watch Topic
  • New Topic

binarysearch explain a line  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On another class i have this :
 
Henry Wong
author
Sheriff
Posts: 23284
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote:On another class i have this :


This class does not compile, and additionally, doesn't really make sense. First, the "Name" variable, has not been declared. Second, the return call of the getName() method won't work, as it is declared as not returning anything (void) at all. Third, how is the UserInput related? Additionally, how is the Koh class related to the Epo class? etc. etc. etc.

In other words, it is probably not really possible to explain something that doesn't work...

Henry
 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
ekte spiriopoulos wrote:On another class i have this :


This class does not compile, and additionally, doesn't really make sense. First, the "Name" variable, has not been declared. Second, the return call of the getName() method won't work, as it is declared as not returning anything (void) at all. Third, how is the UserInput related? Additionally, how is the Koh class related to the Epo class? etc. etc. etc.

In other words, it is probably not really possible to explain something that doesn't work...

Henry
userinput class it is ok I know that when we have void we cant return something but a friend gave me this code ,so its false?It cant be ''if(key_am<f[mid].getName())'' as i have it on line 8, right?
 
Henry Wong
author
Sheriff
Posts: 23284
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote:userinput class it is ok I know that when we have void we cant return something but a friend gave me this code ,so its false?It cant be ''if(key_am<f[mid].getName())'' as i have it on line 8, right?


Considering that you got this code from your friend, and you have questions regarding it, perhaps it would be a good idea to ask your friend regarding it?

Hmmm.... actually, in thinking about it a bit more... Considering that your friend gave you code that doesn't compile, that may not be related, and quite frankly, without any explanation, perhaps it would be a good idea to simply toss it?

Henry
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:Considering that you got this code from your friend, and you have questions regarding it, perhaps it would be a good idea to ask your friend regarding it?

It should perhaps also be mentioned that line 7 of the code in the original post is WRONG.

Subtly wrong admittedly; but wrong.

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