nerdexam
Oracle

1Z0-829 · Question #48

Given: ``java package com.transport.vehicle.cars; public interface Car { int getSpeed(); } ` and `java package com.transport.vehicle.cars.impl; import com.transport.vehicle.cars.Car; public class…

Sign in or unlock 1Z0-829 to reveal the answer and full explanation for question #48. The question stem and answer options stay visible for context.

Working with Modules

Question

Given:
package com.transport.vehicle.cars;

public interface Car {
 int getSpeed();
}
and
package com.transport.vehicle.cars.impl;

import com.transport.vehicle.cars.Car;

public class CarImpl implements Car {
 private int speed;

 public CarImpl() {
 this(10);
 }

 public CarImpl(int speed) {
 this.speed = speed;
 }

 @Override
 public int getSpeed() {
 return speed;
 }
}
Which two should the module-info file include for it to represent the service provider interface?

Unlock 1Z0-829 to see the answer

You've previewed enough free 1Z0-829 questions. Unlock 1Z0-829 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#module-info#service provider interface#provides directive#uses directive
Full 1Z0-829 Practice