Return to site

JAVA CERTIFICATION QUESTION: Functional interfaces and error handling in Java

👉𝐇𝐨𝐰 𝐟𝐮𝐧𝐜𝐭𝐢𝐨𝐧𝐚𝐥-𝐬𝐭𝐲𝐥𝐞 𝐬𝐨𝐟𝐭𝐰𝐚𝐫𝐞 𝐬𝐡𝐨𝐮𝐥𝐝 𝐫𝐞𝐩𝐫𝐞𝐬𝐞𝐧𝐭 𝐚 𝐫𝐞𝐜𝐨𝐯𝐞𝐫𝐚𝐛𝐥𝐞 𝐞𝐫𝐫𝐨𝐫.

· java,ocp

Imagine that you are developing a high-load message board application  that will use nonblocking communication with a database.

This communication will be handled using the following service class:

Which functional interface could be used to expose the MsgBoardService getCommentCount method? Choose one.

A. Function

B. Supplier

C. IntUnaryOperator

D. Callable

E. A custom interface