NEW
Font size
WorksheetsCode.org Lists
Total questions: 9
Worksheet time: 5mins
What is the definition of a List?
An ordered collection of elements
Where information is stored in a variable
The number that identifies each individual element
Where information is written in Java
Which of the following creates a list in the code?
var aList( )
aList{ }
var aList[ ]
aList: ;
Which of the following commands adds an element to the end of the list?
append.list(element)
append.Item(list, element)
list.append()
(element)append
An Element is an individual value in a list that is assigned a unique index
True
False
The length of a list is how many elements it contains. Lists can grow or shrink as elements are added or removed, but the length of the list does not change.
True
False
What is the value at index 1
74
53
22
favNums
What do code do we use to up the "counter" variable by 1 each time we traverse through a "for" loop?
Var i = i + 1
i = 0
i ++
i +
We use a for loop to traverse a list, visiting each element one at a time.
True
False
What will the output be?
[1,4,12,8,6,9,4]
[2,5,13,9,7,10,5]
[4,7,15,11,9,12,7]
[4,7,15,11,6,9,4]
