Search:

Type: Posts; User: dlorde

Search: Search took 0.08 seconds.

  1. Replies
    7
    Views
    1,516

    Re: Printing an array

    OK, but my use of the variable name 'array' was just a generic example - I wasn't suggesting you use it. Always use descriptive names that tell people what the role of the variable or method or class...
  2. Replies
    7
    Views
    1,516

    Re: Printing an array

    A magic number is a numeric literal placed directly in your code, and should be avoided. Far better to use a well named variable initialized with that value. In your code, the magic numbers are the...
  3. Replies
    7
    Views
    1,516

    Re: Printing an array

    So is it fixed, or do you still get errors?

    Incidentally, when looping through arrays, don't use 'magic numbers' to hard-code the length, use array.length. This way, you can't put in the wrong...
Results 1 to 3 of 3