Forums Register Login

binarysearch explain a line

+Pie Number of slices to send: Send
On another class i have this :
1
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
 

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?
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
 

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
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 391 times.
Similar Threads
how i call this thing to my main class
Bubble Sort Array
HELP
java help as soon as possible
Recursive File List - Help me problem solve please
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:56:46.