17.16 Q1: Which of the following statements is false?
a. Some event-listener interfaces are functional interfaces.
b. For such interfaces as mentioned in (a), you can implement event
handlers with lambdas.
c. For a simple event handler, a lambda significantly reduces the
amount of code you need to write.
d. All of the above are true.
17.17 Additional Notes on Java SE 8 Interfaces
17.17 Q1: Which of the following statements is false?
a. Functional interfaces must contain only one method and that
method must be abstract.
b. When a class implements an interface with default methods and
does not override them, the class inherits the default methods’
implementations. An interface’s designer can now evolve an interface
by adding new default and static methods without breaking existing
code that implements the interface.
c. If one class inherits the same default method from two interfaces,
the class must override that method; otherwise, the compiler will
generate a compilation error.
d. You can create your own functional interfaces by ensuring that each
contains only one abstract method and zero or more default or
static methods.
17.17 Q2: You can declare that an interface is a functional interface by
preceding it with the @FunctionalInterface annotation. The
compiler will then ensure that the interface contains ________;
otherwise, it’ll generate a compilation error.
a. no abstract methods
b. all abstract methods
c. only one abstract method