Note: Be careful when coding such things as:-
while (scanner.hasNext()) {
String Name = scanner.next();
String Surname = scanner.next();
}
because hasNext() only checks to...
Type: Posts; User: newbie
Note: Be careful when coding such things as:-
while (scanner.hasNext()) {
String Name = scanner.next();
String Surname = scanner.next();
}
because hasNext() only checks to...
Here is an example of a method which would take a List of Strings as parametrised input, then add a String to it, then return that list.
public List<String> getList(List<String> list){
//read...
My own instinct would to go with the Scanner class, due to having simple ways of parsing primitives (i.e. nextInt() etc) for your problem.
Along with the aesthetic bonus of a lot less code :P
...
Look at using the Scanner class and applying a comma as the delimiter.
I suggest you read through the API to understand what needs to be done.
Meanwhile, here's a tutorial on the basics of using...