Lambdas e Interfaces Funcionales 2

Lambdas e Interfaces Funcionales 2

1st Grade

6 Qs

quiz-placeholder

Similar activities

Function

Function

1st - 3rd Grade

10 Qs

	М1 У4. Вложенные конструкции

М1 У4. Вложенные конструкции

1st Grade

8 Qs

Unity 10 урок

Unity 10 урок

KG - Professional Development

10 Qs

Python Quiz-2

Python Quiz-2

1st - 3rd Grade

10 Qs

Ôn tập Xâu Tệp Chương Trình Con

Ôn tập Xâu Tệp Chương Trình Con

KG - 12th Grade

10 Qs

Python_Lecția_3

Python_Lecția_3

1st Grade

10 Qs

JAVA QUIZ

JAVA QUIZ

1st - 12th Grade

11 Qs

PL2 Midterm Quiz

PL2 Midterm Quiz

1st - 5th Grade

10 Qs

Lambdas e Interfaces Funcionales 2

Lambdas e Interfaces Funcionales 2

Assessment

Quiz

Computers

1st Grade

Medium

Created by

Jose Diaz

Used 4+ times

FREE Resource

6 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

3 mins • 1 pt

Which of the following expressions can be used to implement a Function<Integer, String> ?. Please select 3 options

(a)-> Integer.toHexString(a)

a -> Integer::toHexString

Integer::toHexString

i::toHexString
(Assume that i is a reference to an Integer object.)

(Integer a)-> Integer.toHexString(a)

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Media Image

Please select 1 option.

Compilation error at //1

Compilation error at //2

15

-15

20

3.

MULTIPLE SELECT QUESTION

3 mins • 1 pt

Media Image

Please select 3 options.

process(fnames, t::eat);

process(fnames, t::calories);

process(fnames, TestClass::size);

process(fnames, Carnivore::calories);

process(fnames, Tiger::eat);

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Which of the following interface definitions can be implemented using lambda expressions?. Please select 1 option.

interface A{

}

@FunctionalInterface

interface A{

default void m(){};

}

interface A{

void m(){};

}

interface A{

default void m1(){};

void m2();

}

@FunctionalInterface

interface A{

void m1();

void m2();

}

5.

MULTIPLE SELECT QUESTION

3 mins • 1 pt

Which of the following is/are a valid functional interface(s)?. Please select 3 options.

@FunctionalInterface
public interface FI{
   int m1();
   boolean equals(Object o);
}

@FunctionalInterface
public interface FI{
   String toString = "VALUE";
   int m1();
   String m2(String s);
}

public interface FI{
   int m1();
   String toString();
}

@FunctionalInterface
public interface FI{
   int m1();
   default int m2(){ return 10; }
   String toString();
}

@FunctionalInterface
public interface FI{
   String toString = "VALUE";
   boolean equals(Object o);
}

6.

MULTIPLE SELECT QUESTION

3 mins • 1 pt

Media Image

Please select 2 options.

int a; String b;
Doer d = (a,  b)->b.substring(0, a);

int a = 0; String b = "";
Doer d = (a,  b)->b.substring(0, a)

Doer d = (a, b)->b.substring(0, a);

Doer d = (int a, String b)->b.substring(0, a);

Doer d = a, b->b.substring(0, a);