Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    11
    Views
    1,378

    Re: Very new to Java, getting some syntax errors

    There must be a class name within the <> to declare what type the list contains


    Where is qAns declared? It must be in scope (declared within the {}s) where it referenced.
    See my post#2
  2. Replies
    11
    Views
    1,378

    Re: Very new to Java, getting some syntax errors

    What line is line 15?


    Where is qAns declared? I do see the symbol qAns used in the posted code. What code did that come from?
    I see a similar named variable: QAns

    I therefore assume you...
  3. Replies
    11
    Views
    1,378

    Re: Very new to Java, getting some syntax errors

    Please copy the full text of the error message and paste it here.


    Can you post the code that did not throw errors? The variable: QAns must have been declared in scope for the code to compile...
  4. Replies
    11
    Views
    1,378

    Re: Very new to Java, getting some syntax errors

    A problem with the posted code is that the import statements are inside of the class declaration. They need to be moved outside.

    import java.util.ArrayList;
    import java.util.Scanner;

    public...
  5. Replies
    11
    Views
    1,378

    Re: Very new to Java, getting some syntax errors

    Please copy the current code and paste it here.
    The posted code will not compile because the import statements are inside of the class. They should be before the class.

    Changing an ArrayList to...
  6. Replies
    11
    Views
    1,378

    Re: Very new to Java, getting some syntax errors

    Where is the variable QAns defined that is in scope where it is referenced?

    The only declaration for QAns I see is as a local parameter to the Trivia class.
    It looks like that variable needs to...
Results 1 to 6 of 6