There is an interface:
public interface RobotConnectionManager { RobotConnection getConnection(); } And there is a method:
public static void moveRobot(RobotConnectionManager robotConnectionManager, int toX, int toY) { RobotConnection rc = robotConnectionManager.getConnection(); rc.moveRobotTo(toX, toY); } I do not understand, but according to this there are a trace. questions:
when the
moveRobot();method is called in MainmoveRobot();don't understand what should i write torobotConnectionManager?RobotConnectionis also an interface with its own method. How in Java to explain what is happening in this line:RobotConnection rc = robotConnectionManager.getConnection();What you need to read to understand it.