Maneesh Godbole wrote:Core Java by Horstmann and Cornell
Also check out Sun's swing tutorial
Eduardo Bueno wrote:Sorry but we are NotACodeMill. If you really did that code, you could easily do what you want just by looking at Scanner and String documentations.
Campbell Ritchie wrote:It does nobody any good to have a direct alteration to their code; they don't learn anything like that.
When you read the API documentation, what did you not understand? Then we can explain it for you.
Campbell Ritchie wrote:Please read the documentation for Scanner, find out what a "delimiter" is, what it uses as default delimiter, and also find out what happens when you push the enter key.
You may occasionally have to call the Scanner#next() method and discard the next token so as to keep your input Scanner and keyboard in step with each other.
Fred Hamilton wrote:In addition to having the method throw the exception as you have done here, you should also learn about the try/catch method of handling exceptions.
Anyways, in this case it's all about how the program is supposed to react if the filename you specify in the program doesn't actually exist. You have to tell the program how to react to that situation.
probably you would benefit from some study of the concept of exception handling in java, you will encounter it a lot.
The Java Tutorial does a pretty good job, but there's plenty of other sources too.
http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html
Jon Kho wrote:
do use "www.google.com" or any other search engines because it has many examples on array list..
Michael Angstadt wrote:
Muzafar Ali wrote:how to get input from scanner to set values in Array;
then retrieve them.
Use java.util.ArrayList. It's like an array, but it doesn't have a fixed size, so you can add as many Strings to it as you want