Results 1 to 3 of 3
  1. #1
    Zebra's Avatar
    Zebra is offline Member
    Join Date
    Apr 2008
    Location
    Louisville, Indiana/Kentucky
    Posts
    64
    Rep Power
    0

    Default Need another program with and if-else, array, and for loop

    Please. If you can make it I will love you forever. Please I need a program (doesn't matter what about, doesn't have to be advanced). I just need a study guide for my big Java I final coming up.

    The program needs:
    -For loop
    -Array
    -If-else statement

    Thanks. Hope somebody can help me.
    I am a Java n00b.

  2. #2
    theonly is offline Member
    Join Date
    Apr 2008
    Posts
    23
    Rep Power
    0

    Default

    The following is not a full program, but sample codes.

    Java Code:
    // For loop & Array & If-else program
    
    //Creating array of length 21
    String[] array = new String[20];
    
    // Code for filling array with number 0 - 20
    for( int i = 0; i < array.length -1; i++ )
    {
         array[i] = i;
    }
    
    // If-else statement
    if (array != null)
    {
        System.out.println("Array is not empty");
    }
    else
    {
        System.out.println("Array is empty");
    }

  3. #3
    Zebra's Avatar
    Zebra is offline Member
    Join Date
    Apr 2008
    Location
    Louisville, Indiana/Kentucky
    Posts
    64
    Rep Power
    0

Similar Threads

  1. Replies: 8
    Last Post: 04-22-2008, 03:21 AM
  2. Array program help
    By adelgado0723 in forum New To Java
    Replies: 2
    Last Post: 04-16-2008, 01:19 PM
  3. Timing array loop performance
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-14-2008, 08:43 PM
  4. Need help with my 1st array program
    By Phobos0001 in forum New To Java
    Replies: 5
    Last Post: 03-22-2008, 06:23 AM
  5. Replies: 0
    Last Post: 10-04-2007, 09:33 PM

Posting Permissions

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