我需要找出一种方法将下面的地图作为String [] []
返回public class Board {
private Map<String[], int[]> rows;
private String code;
private int tries;
public Board(String code, int size) {
this.tries = 0;
this.code = code;
this.rows = new HashMap<>();
}
public Map<String[], int[]> getRows() {
return rows;
}
它来自这个类
initialize
答案 0 :(得分:1)
public class Board {
private Map<String, int[][]> rows;
private String code;
private int tries;
public Board(String code, int size) {
this.code = code;
this.tries = 0;
this.rows = new HashMap<>(size);
}
public Map<String, int[][]> getRows(String code) {
return rows !=null ? rows.get(code):null;
}
public void setRows(String code, int[][] data) {
if(rows == null)
rows = new HashMap<>();
rows.put(code,data);
}