Analyze the following code:

```
public class Test {
public static void main(String[] args) {
Test test = new Test();
test.setAction(() -> System.out.print("Action 1! "));
}

public void setAction(T t) {
t.m1();
}
}

interface T {
public void m1();
public void m2();
}
```
a. The program displays Action 1.
b. The program has a compile error because T is not a functional interface. T contains multiple methods.
c. The program would work if you delete the method m2 from the interface T.
d. The program has a runtime error because T is not a functional interface. T contains multiple methods.


b. The program has a compile error because T is not a functional interface. T contains multiple methods.
c. The program would work if you delete the method m2 from the interface T.

Computer Science & Information Technology

You might also like to view...

As you insert and delete rows and columns, Excel adjusts _____ cell references in formulas to keep them accurate.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

For the following template declaration of the following function,

``` template void problem_6 (T object); ``` a) Give a statement that causes the compiler to generate a function that passes int values to the function problem_6 b) Give an equivalent function declaration (prototype) for the function generated by this usage

Computer Science & Information Technology

Which of the following identifies customers and stores all customer-related data, particularly contact information and data on any direct contact with customers?

A. ERP B. CRM C. GRC D. ESB

Computer Science & Information Technology

Select the specific type of interview that is usually conducted when an employee leaves the company?

A. last interview B. initial interview C. exit interview D. post interview

Computer Science & Information Technology