public class Race { String currentLeader = ""; // ТекÑÑий Ð»Ð¸Ð´ÐµÑ Ð³Ð¾Ð½ÐºÐ¸ int leaderDistant = 0; // ÐиÑÑанÑиÑ, пÑÐ¾Ð¹Ð´ÐµÐ½Ð½Ð°Ñ ÑекÑÑим лидеÑом public void determineNewLeader(Car car) { int timeRace = 24; int newDistance = timeRace * car.speed; if (newDistance > leaderDistant) { currentLeader = car.name; leaderDistant = newDistance; } } public String getCurrentLeader() { return currentLeader; } }