Question 97 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question 97 of 130 from exam 1Z0-809: Java SE 8 Programmer II

Question

Given:

class Engine {
double fuelLevel;
Engine(int fuelLevel) { this.fuelLevel = fuelLevel; }
public void start() {
// line ni
System. out .print1n ("Started");
}
public void stop() { System.out.println("Stopped"); }

Your design requires that: -> fuelLevel of Engine must be greater than zero when the start() method is invoked.

-> The code must terminate if fuelLevel of Engine is less than or equal to zero.

Which code fragment should be added at line n1 to express this invariant condition?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.