Exam 1z0-829 All QuestionsBrowse all questions from this exam
Question 39

Given:

and

Which two should the module-info file include for it to represent the service provider interface? (Choose two.)

    Correct Answer: A, G

    To represent the service provider interface correctly in the module-info file, two important declarations are needed: exporting the package with the service interface and providing the implementation for the service interface. First, the package containing the service interface, 'com.transport.vehicle.cars', should be exported, which is handled by the 'exports com.transport.vehicle.cars;' statement. Second, the relationship between the service interface and its implementation needs to be specified. This is done with the 'provides com.transport.vehicle.cars.Car with com.transport.vehicle.cars.impl.CarImpl;' statement, indicating that 'CarImpl' is the provider for the 'Car' service interface.

Discussion
azdanOptions: AG

requires must be module name only