
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
15 questions
ROTC Make-up Quiz

Quiz
•
University
15 questions
PROBLEM SOLVING USING R UNIT I MCQS

Quiz
•
University
15 questions
PROBLEM SOLVING USING R - UNIT II - TEST 2 - MCQS

Quiz
•
University
12 questions
Web Apps 03 - MongoDB

Quiz
•
University
10 questions
Java Static

Quiz
•
University
10 questions
Object/Abstract/Final in JAVA

Quiz
•
University
10 questions
SS2425 WMAD S6+L17 Quiz Time

Quiz
•
University
15 questions
[Python For All] Quiz 5 - Numpy

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University