I am a beginner too. The only advise i can give you is write down the logic of your program and make a design of it before you try to implement it. I didn't do that when i first started java...
Type: Posts; User: andreas90
I am a beginner too. The only advise i can give you is write down the logic of your program and make a design of it before you try to implement it. I didn't do that when i first started java...
Why are you using a nested loop? What do you need the loop that goes through Alphabet? I think that you will get what you want by removing the inner for loop but are you having (and writing...
I suggested you to use result not i as an index.
Instead of printing result you can use result as an index in the Alphabet array and print the element in the specified index.
What if you assign "value" the charAt(int) method of the String the user inputs and then do the binarySearch with it - both inside the for loop?
You do that with your for loop if i'm getting it right.
Check out the charAt(int) method of the String class. You can use it inside the for loop as value.
result should be -1 as you mentioned in post #16. result +1 = -1+1 = 0
Am i missing something?
What does it do instead?
Take a look at here
Hello Nuggets!
Why are you using FileReader to read from the console? In my opinion you are using way too much code for just asking the user for input.
And also, as i can see you have in your for...