just google "Scanner java api" and go to the latest version (7), then search on the page, and you'll find this:
[that method in the api](http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html#findWithinHorizon(java.lang.String, int))
thanks for your help, I have found it but I am not entirely sure the API is helping me, sorry perhaps I still need to get used to the API. I have found this
reply = keyboard.findWithinHorizon(".",0).charAt(0); but I am not entirely sure I understand it. The methid takes 2 parameters
(String pattern,int horizon) which in my case are "." and "0", but what do they do in my case? I mean how am I supposed to "read" this line
reply = keyboard.findWithinHorizon(".",0).charAt(0);? The variable reply gets the input from the keyboard and we take what's in 0 position?
either that, or a pattern instead of a string.
no, reply only gets the very first character of the substring of the input through the keyboard, which is found by the findWithinHorizon method.
if you want to know for sure what it all does: change your input, change some of the values and use temporal variables to store the steps in between.
String inpWithin = keyboard.findWithinHorizon(".",0); char reply = inpWithin.charAt(0);
and print those two values. change the parameters you send to the findWithinHorizon method, and see what changes.
very important: never confuse 0 with "0", they are two completely different values: the first is a numerical value (most likely an int, which it is here), the second is an object of the type String.
ok thank you
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.
This is the result of previous question answered :
code for the listbox - datagridview interaction
At the top of the code ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...