Java SE 11 Developer (1Z0-819) — Question 94

Which module-info.java is correct for a service provider for a print service defined in the PrintServiceAPI module?

Answer options

Correct answer: B

Explanation

The correct answer, B, properly defines a service provider that specifies which implementation class (com.provider.PrintService) provides the service interface (org.printservice.spi.Print). Option A incorrectly uses 'exports' instead of 'provides', C merely indicates usage without providing an implementation, and D incorrectly uses 'exports' when it should be 'provides' to define the service provider relationship.