Results 1 to 2 of 2
  1. #1
    toby is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default Help with method length

    I cant figure out what is wrong with this code:

    Java Code:
    int [] numbers = {3, 2, 3, 6, 9, 10, 12, 32, 3, 12, 6};
    for (int count = 1; count <= numbers.length; count++)
    System.out.println (numbers [count]);
    Any ideas why it's wrong?
    Thanks

  2. #2
    Seemster is offline Member
    Join Date
    Jul 2007
    Posts
    55
    Rep Power
    0

    Default

    for (int i=0;i<numbers.length;i++) {
    System.out.println(numbers[i]);
    }

Similar Threads

  1. Replies: 2
    Last Post: 03-26-2010, 06:12 PM
  2. Using reflection to check array type and length
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 09:42 PM
  3. Replies: 2
    Last Post: 03-25-2008, 06:49 AM
  4. Replies: 2
    Last Post: 12-12-2007, 06:01 PM
  5. Determining Midi Length
    By Usagi in forum New To Java
    Replies: 0
    Last Post: 12-09-2007, 12:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •