
L4 Collections & Arraylist

Quiz
•
Computers
•
University
•
Hard
Coder Warman
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a dynamic array in Java?
An array with fixed size
An array that can resize itself when elements are added beyond its capacity
A data structure that only supports reading elements
A list that can store only integers
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main advantage of using an ArrayList over a regular array in Java?
ArrayList allows duplicate elements
ArrayList can grow and shrink dynamically
ArrayList has faster access time than an array
ArrayList can only hold primitive data types
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax for creating an ArrayList of integers in Java?
ArrayList list = new ArrayList<>();
ArrayList list = new ArrayList<>();
ArrayList[] list = new ArrayList();
ArrayList list = new ArrayList[10];
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to add an element to an ArrayList in Java?
add()
insert()
append()
push()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you initialize an empty ArrayList in Java?
new ArrayList();
ArrayList list = new ArrayList();
ArrayList list();
ArrayList list = new ArrayList();
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the Iterable interface in Java represent?
A collection of objects stored in an array
A structure that can be iterated over using a for-each loop
A class that allows only one element at a time
A data structure that can only be iterated using an iterator
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default initial capacity of an ArrayList in Java?
10
1
5
20
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
web Development QUIZ

Quiz
•
University
15 questions
Soal Java

Quiz
•
11th Grade - University
10 questions
JSPS Competition Hackathon - HTML Language Grade 4 & 5

Quiz
•
4th Grade - University
10 questions
java script

Quiz
•
University
15 questions
C++Arrays Loops and Functions Review

Quiz
•
University
15 questions
Python Workshop Day - 2

Quiz
•
University
8 questions
J277 - 2.2 - Use of Arrays up to 2D

Quiz
•
10th Grade - University
10 questions
Weekly Contest #3 - TechXNinjas

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University