摘要:
怎么编写能使用泛型当作参数的函数? 可以使用this来给参数赋默认值 public class Rectangle { private int x, y; private int width, height; public Rectangle() { this(0, 0, 1, 1); // 默认值 阅读全文
摘要:
HashMap 继承关系 遍历 // initialize a HashMap HashMap<String, Integer> map = new HashMap<>(); // Iterate the map using // for-each loop for (Map.Entry<Strin 阅读全文