Arrays
2 years ago
wespetal
Save
Edit
Host a game
Live GameLive
Homework
Solo Practice
Practice
10 QuestionsShow answers
  • Question 1
    120 seconds
    Report an issue
    Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
    System.out.println("Number: " + numArray[2]);
    answer choices
    Number: 2
    Number: 7
    Number: 4
    Number: 12
  • Question 2
    120 seconds
    Report an issue
    Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
    System.out.println("Number: " + numArray[0]);
    answer choices
    Number: 2
    Number: 7
    Number: 4
    Number: 12
  • Question 3
    120 seconds
    Report an issue
    Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
    System.out.println("Number: " + numArray[numArray.length - 1]);
    answer choices
    Number: 2
    Number: 0
    Number: 12
    Number: 6
  • Question 4
    120 seconds
    Report an issue
    Q. What does the following segment of code print out? int[] numArray = { 2, 7, 4, 12, 0, 2 };
    System.out.println(numArray.length);
    answer choices
    4
    5
    6
    7
  • Question 5
    120 seconds
    Report an issue
    Q. What is the correct way to initialize an array with 10 positions?
    answer choices
    int numbers = new int[10];
    int[] numbers = new int[];
    int[10] numbers = new int[10];
    int[] numbers = new int[10];
  • Question 6
    120 seconds
    Report an issue
    Q. What value is stored in each of the 5 positions in this array? (What is the default value provided by Java).
    int[] numbers = new int[5];
    answer choices
    null
    1
    0
    nothing
  • Question 7
    120 seconds
    Report an issue
    Q. What value is at index 1 in this array?  String[] names = {"Mack", "Dennis", "Dee", "Charlie"};
    answer choices
    Mack
    Dennis
    Dee
    Charlie
  • Question 8
    120 seconds
    Report an issue
    Q. What value is at index 3 in this array?  String[] names = {"Mack", "Dennis", "Dee", "Charlie"};
    answer choices
    Mack
    Dennis
    Dee
    Charlie
  • Question 9
    120 seconds
    Report an issue
    Q. What is the correct way to create an array with these three numbers: 12  8  15
    answer choices
    int[] = {12, 8, 15};
    int[] nums = {12  8  15};
    int[] nums = {12, 8, 15}
    int[] nums = {12, 8, 15};
  • Question 10
    120 seconds
    Report an issue
    Q. True or False:  An array can be store different types of data (like store both doubles and ints).
    answer choices
    True
    False
Report an issue
Why show ads?
Report Ad
Join a game