Java SE 11 Developer (1Z0-819) — Question 43
Which two interfaces are considered to be functional interfaces? (Choose two.)
Answer options
- A. @FunctionalInterface interface InterfaceC { public boolean equals(Object o); int breed(int x); int calculate(int x, int y); }
- B. @FunctionalInterface interface InterfaceD { int breed(int x); }
- C. @FunctionalInterface interface InterfaceE { public boolean equals(int i); int breed(int x); }
- D. interface InterfaceA { int GERM = 13; public default int getGERM() { return GERM; } }
- E. interface InterfaceB { int GERM = 13; public default int getGERM() { return get(); } private int get() { return GERM; } public boolean equals(Object o); int breed(int x); }
Correct answer: A, C
Explanation
The correct answers are A and C because they both define a single abstract method, which is the requirement for a functional interface. Options B, D, and E either define more than one abstract method or do not meet the criteria of a functional interface.