Collection2

Collection2

1st Grade

5 Qs

quiz-placeholder

Similar activities

demon slayer para mi afrodita <3

demon slayer para mi afrodita <3

1st Grade

8 Qs

Ôn tập

Ôn tập

1st Grade

8 Qs

Life

Life

KG - Professional Development

5 Qs

SR IND

SR IND

1st - 5th Grade

8 Qs

UAE Social Studies Quiz (Not Actually Philosophy)

UAE Social Studies Quiz (Not Actually Philosophy)

KG - Professional Development

4 Qs

Философские проблемы социальной динамики

Философские проблемы социальной динамики

1st - 5th Grade

10 Qs

Part 2 functionalism

Part 2 functionalism

1st Grade

10 Qs

FUNCIONES TRIGONOMETRICAS

FUNCIONES TRIGONOMETRICAS

1st - 2nd Grade

5 Qs

Collection2

Collection2

Assessment

Quiz

Philosophy

1st Grade

Hard

Created by

khushbu mehta

Used 3+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which of the following are true about the following code? (Choose all that apply)

public class Create {

Create() { System.out.print("1 "); }

Create(int num) {

System.out.print("2 "); }

Create(Integer num) {

System.out.print("3 "); }

Create(Object num) {

System.out.print("4 "); }

Create(int... nums) { System.out.print("5 "); }

public static void main(String[] args) {

new Create(100);

new Create(1000L); } }

2 4

3 4

2 5

compile error

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which of the following lambda expressions can fill in the blank?

List list = new ArrayList<>();

list.removeIf(___________________);

s -> s.isEmpty()

s -> {s.isEmpty()}

s -> {s.isEmpty();}

s -> {return s.isEmpty();}

3.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is the result of the following statements?

3: ArrayList<Integer> values = new ArrayList<>();

4: values.add(4);

5: values.add(5);

6: values.set(1, 6);

7: values.remove(0);

8: for (Integer v : values)

System.out.print(v);

5

6

4

compile error

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What will be the output?

List<Integer> ages = new ArrayList<>();

ages.add(Integer.parseInt("5"));

ages.add(Integer.valueOf("6"));

ages.add(7);

ages.add(null);

for (int age : ages) System.out.print(age);

5 6 7

Compilation error

Runtime exception

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

List<String> one = new ArrayList<String>();

one.add("abc");

List<String> two = new ArrayList<>();

two.add("abc");

if (one == two)

System.out.println("A");

else if (one.equals(two))

System.out.println("B");

else

System.out.println("C");

A

B

C

Run time exception