
Java 1D ArrayLists Quiz
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
Tony Banning
Used 2+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare an ArrayList in Java?
`ArrayList al = new ArrayList();`
`ArrayList[] al = new ArrayList();`
`ArrayList<> al = new ArrayList<>();`
`List al = new ArrayList();`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to initialize an ArrayList of Strings?
`ArrayList
`ArrayList list = new ArrayList
`List
All of the above
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you add an element to an ArrayList?
`list.addElement("Hello");`
`list.add("Hello");`
`list.insert("Hello");`
`list.put("Hello");`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the element at index 2 in an ArrayList `list`?
`list[2];`
`list.get(2);`
`list.elementAt(2);`
`list.indexOf(2);`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to modify the element at index 3 in an ArrayList `list`?
`list.set(3, "New Element");`
`list.add(3, "New Element");`
`list.replace(3, "New Element");`
`list.update(3, "New Element");`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you remove the element at index 4 in an ArrayList `list`?
`list.remove(4);`
`list.delete(4);`
`list.erase(4);`
`list.cut(4);`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a built-in method of ArrayList?
`clear()`
`length()`
`size()`
`isEmpty()`
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
AP CSP Review 11Q
Quiz
•
10th - 12th Grade
10 questions
Review I-PM Ujikom Multimedia
Quiz
•
12th Grade
15 questions
Unbound Report Quiz
Quiz
•
9th - 12th Grade
14 questions
BÀI 14- THUẬT TOÁN TÌM KIẾM TUẦN TỰ
Quiz
•
6th Grade - University
11 questions
Access
Quiz
•
10th Grade - University
14 questions
Linux: Users and Groups
Quiz
•
9th Grade - University
10 questions
Les variables sous Python
Quiz
•
10th - 12th Grade
15 questions
QUIZ INTEGRASI PERKANTORAN - KELAS X
Quiz
•
10th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
