
L4 Collections & Arraylist
Authored by Coder Warman
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
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
10 questions
Software Testing
Quiz
•
University
10 questions
Ke-Al Azhar 8 an
Quiz
•
7th Grade - University
15 questions
HTML Quiz
Quiz
•
11th Grade - University
10 questions
C++ Array Quiz
Quiz
•
University
15 questions
Computer Applications in Banking and Finance Quiz
Quiz
•
University
10 questions
Tutorium1
Quiz
•
University
10 questions
Node.js
Quiz
•
University
10 questions
PHP Introduction - Assignment 1
Quiz
•
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