Given:
public interface Moveable
public default void walk (Integer distance) {System.out.println("Walking");) public void run(Integer distance);
}
Which statement is true?
Given:
public interface Moveable
public default void walk (Integer distance) {System.out.println("Walking");) public void run(Integer distance);
}
Which statement is true?
The correct usage of the Moveable interface can be specified using a lambda expression with the correct method signatures for walk and run. The statement in option A correctly uses a lambda expression to implement the run method, while the walk method, being a default method, is already implemented and can be called directly. Therefore, option A is correct as it follows the interface's contract and correctly utilizes default and abstract methods.
Answer A. Tested
A is the answer tested
Answer is A.