Quiz
Practice Quiz Lesson 9
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (10)
1This code will run:
int [][] numbers = new int numbers[3][];- ATrue
- BFalse
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?- A[0][1]
- B[1][1]
- C[1][2]
- D[0][2]
3Can 2D Arrays vary in length?
- ATrue
- BFalse
4What is the correct formula for a for loop?
- Afor( <statement>; <initialization>; <condition>;)
<update>; - Bfor( <condition>; <initialization>; <update>;)
<statement>; - Cfor( <initialization>; <condition>; <statement>;)
<update>; - Dfor( <initialization>; <condition>; <update>;)
<statement>;
- Afor( <statement>; <initialization>; <condition>;)
5What would print out?
String [][] names = new String {{"Gary", "Albert", "Athena"}, {"Ashley", "Po Ming", "Kate", "Pedram"}};
System.out.println(names[1][2]);- AAlbert
- BAthena
- CPo Ming
- DKate
6In Java, collections...
- Acannot vary in size
- Bcan only contain any reference types
- Care sets, lists and maps
- Dall of the above
7ArrayLists are Arrays
- ATrue
- BFalse
8what is the correct for-each loop?
- Afor(int i = 0 ; i < numbers.length ; i++)
{
System.out.println(i)
} - Bfor( n Numbers : numbers)
{
System.out.rpintln(n)
} - Cfor(int i = 5 ; 5 == 5 ; i++)
{
System.out.println(i)
} - Dfor(Numbers n : numbers)
{
System.out.println(n)
}
- Afor(int i = 0 ; i < numbers.length ; i++)
9This creates an anonymous object in memory:
Book book1 = new Book();
library.add(book1);- ATrue
- BFalse
10Arrays are measured with what operator?
- A.length()
- B.length
- C.size()
- D.size
Information
- Description
- Quiz on Practice Quiz Lesson 9, created by Athena Kozak on 22/03/2019.
- Author
- Athena Kozak
- Language
- English
- Views
- 2
- Rating
- No ratings yet Rate this quiz