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.

bc

Computer Science & Information Technology

You might also like to view...

To select a variety of files that are not adjacent in order to delete them as a group, hold down the ________ while selecting each one

A) F1 B) Ctrl C) Alt D) Shift

Computer Science & Information Technology

Briefly explain how margins can collapse.

What will be an ideal response?

Computer Science & Information Technology