GoConqr has a new look! Let us know what you think.

Quiz

Practice Quiz Lesson 9

Athena Kozak 10 questions

Take the quiz

Questions in this quiz (10)

  1. 1This code will run:

    int [][] numbers = new int numbers[3][];
    1. ATrue
    2. BFalse
  2. 2What is the 2D array location for the following?

    int [][] numbers = {{1,2,3,4},{8,7,6}};

    What is the 'array address' of 7?
    1. A[0][1]
    2. B[1][1]
    3. C[1][2]
    4. D[0][2]
  3. 3Can 2D Arrays vary in length?
    1. ATrue
    2. BFalse
  4. 4What is the correct formula for a for loop?
    1. Afor( <statement>; <initialization>; <condition>;)
      <update>;
    2. Bfor( <condition>; <initialization>; <update>;)
      <statement>;
    3. Cfor( <initialization>; <condition>; <statement>;)
      <update>;
    4. Dfor( <initialization>; <condition>; <update>;)
      <statement>;
  5. 5What would print out?

    String [][] names = new String {{"Gary", "Albert", "Athena"}, {"Ashley", "Po Ming", "Kate", "Pedram"}};

    System.out.println(names[1][2]);
    1. AAlbert
    2. BAthena
    3. CPo Ming
    4. DKate
  6. 6In Java, collections...
    1. Acannot vary in size
    2. Bcan only contain any reference types
    3. Care sets, lists and maps
    4. Dall of the above
  7. 7ArrayLists are Arrays
    1. ATrue
    2. BFalse
  8. 8what is the correct for-each loop?
    1. Afor(int i = 0 ; i < numbers.length ; i++)
      {
      System.out.println(i)
      }
    2. Bfor( n Numbers : numbers)
      {
      System.out.rpintln(n)
      }
    3. Cfor(int i = 5 ; 5 == 5 ; i++)
      {
      System.out.println(i)
      }
    4. Dfor(Numbers n : numbers)
      {
      System.out.println(n)
      }
  9. 9This creates an anonymous object in memory:
    Book book1 = new Book();
    library.add(book1);
    1. ATrue
    2. BFalse
  10. 10Arrays are measured with what operator?
    1. A.length()
    2. B.length
    3. C.size()
    4. D.size

Information

Description
Quiz on Practice Quiz Lesson 9, created by Athena Kozak on 22/03/2019.
Language
English
Views
2
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?