Java Quiz 2

Java Quiz 2

University

40 Qs

quiz-placeholder

Similar activities

[Sun*_Internship] Web Backend Quizzes

[Sun*_Internship] Web Backend Quizzes

University

35 Qs

Data Structures Quiz

Data Structures Quiz

University

44 Qs

TypeScript_Ver3

TypeScript_Ver3

University

40 Qs

Easy LEVEL

Easy LEVEL

9th Grade - University

40 Qs

Pemrograman Berorientasi Objek 11RPL Sem 1

Pemrograman Berorientasi Objek 11RPL Sem 1

11th Grade - University

40 Qs

Quiz Berpikir Komputasional Informatika Kelas X

Quiz Berpikir Komputasional Informatika Kelas X

10th Grade - University

35 Qs

Разработка мобильных приложений

Разработка мобильных приложений

University

37 Qs

Java Programming

Java Programming

University

40 Qs

Java Quiz 2

Java Quiz 2

Assessment

Quiz

Computers

University

Hard

Created by

Omphile Mosingathi

Used 3+ times

FREE Resource

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What package does ArrayList belong to?

A. java.io

B. java.util

C. java.lang

D. java.net

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary advantage of using an ArrayList over an array?

A. Fixed size

B. Dynamic size

C. Faster access

D. Less memory usage

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to add an element to an ArrayList?

A. insert()

B. append()

C. add()

D. put()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

ArrayLists cannot store primitive types directly. What should be used instead?

A. Primitive Wrappers

B. Collections

C. Arrays

D. Interfaces

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to create an ArrayList of integers?

A. ArrayList<int> list = new ArrayList<>();

  • B. ArrayList<Integer> list = new ArrayList<>();

C. ArrayList<Int> list = new ArrayList<>();

D. ArrayList<int[]> list = new ArrayList<>();

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you sort an ArrayList in Java?

A. Collections.sort()

B. Arrays.sort()

C. List.sort()

D. ArrayList.sort()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What method is used to remove an element from an ArrayList?

A. delete()

B. remove()

C. erase()

D. cut()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?