Search:

Type: Posts; User: ajw1993

Search: Search took 0.09 seconds.

  1. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    through the scanner in a different class in a method . and also in the sub class it reads in additional data

    public void readData(Scanner scanner)
    {
    group = scanner.next();
    ...
  2. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    nothing is being read in
  3. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    there is data there though , all the vehicles have regNo's and its saying that on 112 that it cant find the regNo,.
  4. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    java.util.NoSuchElementException
    at java.util.Scanner.throwFor(Scanner.java:907)
    at java.util.Scanner.next(Scanner.java:1416)
    at Vehicle.readData(Vehicle.java:112)
    at...
  5. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    there should be 7 for the car , but it keeps coming up null and not storing anything and no it will follow a comment , blank lines then [Van data , then do the van data
  6. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    yeah ino but how do i record it n use the result .
  7. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    thats what the code is , thats why im confused
  8. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    the deal code will create an object , read in the data and also store it in the array
    else
    {
    Scanner scanner2 = new Scanner(lineOfText);
    ...
  9. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    thats what i think should work , when looking at the psuedo code =

    while ( there are more lines in the file)
    {
    lineoftext = nextline from scanner
    if (line start with //)
    {
    ignore
    }
    else if...
  10. Replies
    21
    Views
    1,289

    Re: Recording data , so you know whats next

    there is no problem yet because i just wanted to get this bit right first and it is else if(lineOfText.startsWith("[")

    just wondering what should i put

    --- Update ---

    there is no problem yet...
  11. Replies
    21
    Views
    1,289

    Recording data , so you know whats next

    I have a ptoblem i have 3 types of data in one file for example car data , van data , truck data. The problem is i have to have a flag to check what data is next and set a variable , so we know what...
Results 1 to 11 of 11