AJP-E2

AJP-E2

Professional Development

10 Qs

quiz-placeholder

Similar activities

AWS ACF PT-BR Módulo 3 - Visão da Infraestrutura Global AWS

AWS ACF PT-BR Módulo 3 - Visão da Infraestrutura Global AWS

Professional Development

15 Qs

Mapeamento e Normalização BD

Mapeamento e Normalização BD

University - Professional Development

15 Qs

Tuan 3 - Python

Tuan 3 - Python

KG - Professional Development

10 Qs

Datatypes and Flowcontrol

Datatypes and Flowcontrol

Professional Development

15 Qs

FP2: 01 - MODULOS

FP2: 01 - MODULOS

Professional Development

10 Qs

Python8

Python8

Professional Development

12 Qs

JSKBS - Database Management System

JSKBS - Database Management System

Professional Development

15 Qs

CSS Quiz 2

CSS Quiz 2

University - Professional Development

10 Qs

AJP-E2

AJP-E2

Assessment

Quiz

Computers

Professional Development

Practice Problem

Hard

Created by

RAVIKANTH K

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to create an ArrayList of Strings?

ArrayList<String> list = new ArrayList[];

ArrayList list = new List<String>();

ArrayList list = new ArrayList<String>();

ArrayList<String> list = new ArrayList<>();

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

ArrayList<String> list = new ArrayList<>();

list.add("Java");

list.add("Python");

System.out.println(list.remove(0));

Java

Python

true

Compilation error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one is the correct way to iterate over elements in an ArrayList?

for (int i = 0; i < list.size(); i++)

for (int i : list)

for (Object obj : list)

for (Iterator it = list.iterator(); it.hasNext();

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which collection class provides a way to store elements in key-value pairs?

ArrayList

Maps

LinkedList

All

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

class Main {

public static void main(String args[]) {

int x = 2;

int y = 0;

for ( ; y < 10; y++) {

if (y % x == 0)

continue;

else if (y == 8)

break;

else

System.out.print(y + " ");

}

}

}

1 3 5 7

1 3 5 7 9

8

None

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one of the following collection classes can be used to store unique objects?

HashSet

LinkedHashMap

ArrayList

ALL

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods is used to add an element to the end of an ArrayList?

addLast()

addEnd()

add()

append()

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?