Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Two comments:
    Add this line first thing in main method for ease of testing:


    args = new String[] {"sl", "3"}; // hard code for testing

    Don't hard code any numbers for array indexes....
  2. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Your code is trying to look at the first element. The array is empty.
    Your code must test/check if that array is empty and do something besides get an error.
    Where do you do that check? The answer...
  3. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Please post the full text of the error message.

    Let me change my question:
    Where do you check if there are any elements in the args array?


    This error message says you are trying to look at...
  4. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Is there an error? Please post the full text of the error message.



    What does that mean?
    Are you able to execute the code and get the error messages that are generated?
  5. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Is there an error? Please post the full text of the error message.
  6. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Go read the last line of post #3
  7. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Have you solved the problem or do you have more questions?
  8. Replies
    19
    Views
    3,745

    Re: lotto ticket generator help

    Use the equals() method when comparing Strings. The == operator is for primitives.

    Where do you test if there are any elements in the args array?
Results 1 to 8 of 8