Search:

Type: Posts; User: newbie

Search: Search took 0.15 seconds.

  1. Replies
    31
    Views
    3,248

    Re: Read Text File Into Strings

    Note: Be careful when coding such things as:-

    while (scanner.hasNext()) {
    String Name = scanner.next();
    String Surname = scanner.next();
    }


    because hasNext() only checks to...
  2. Replies
    31
    Views
    3,248

    Re: Read Text File Into Strings

    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...
  3. Replies
    31
    Views
    3,248

    Re: Read Text File Into Strings

    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
    ...
  4. Replies
    31
    Views
    3,248

    Re: Read Text File Into Strings

    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...
Results 1 to 4 of 4