public interface BookDao {public void save();
}
public class BookDaoImpl implements BookDao {private int[] array;private List list;private Set set;private Map map;private Properties properties;public void setArray(int[] array) {this.array = array;}public void setList(List list) {this.list = list;}public void setSet(Set set) {this.set = set;}public void setMap(Map map) {this.map = map;}public void setProperties(Properties properties) {this.properties = properties;}public void save(){System.out.println("book dao save...");System.out.println("遍历数组:"+ Arrays.toString(array));System.out.println("遍历List"+list);System.out.println("遍历Set"+set);System.out.println("遍历Map"+map);System.out.println("遍历Properties"+properties);}
}
public class AppForDICollection {public static void main(String[] args) {ApplicationContext c= new ClassPathXmlApplicationContext("applicationContext.xml");BookDao bookdao= (BookDao) c.getBean("bookDao");bookdao.save();}
}
100 200 300
java spring mysql
springboot vue html
china guangdong guangzhou
配置完成后运行AppForCollection程序,运行结果为:

上一篇:同事的离别伤感的句子