下面是一个使用 Java 实现轮询算法的示例代码:
import java.util.ArrayList;
import java.util.List;
public class RoundRobin {
private int currentIndex = 0;
private List<String> servers = new ArrayList<>();
public RoundRobin(List<String> servers) {
this.servers = servers;
}
public String