public static Map<String, String> [] maps = null ;
public static void newDBParameter(int length){
maps = new HashMap[length] ;//黄色警告
}
maps = new HashMap[length] 这句该怎么写才消除警告
new HashMap<String,String>[length];//报错
至于警告,去设置里关一关就好了。
后面的new HashMap[length]。还是报错。先不管了,@SuppressWarnings("unchecked")就算了。我在封装一个工具类。在赋值的时候用。用list做不到。还是谢谢你。
追答我说的就是改後边的,前边的maps=null不变