遍历List集合删除元素的出现报错 遍历List集合删除元素的时候会发生索引越界异常或内容遍历不全等问题. 例子: List<String> al = new ArrayList<String>(); al.add("12"); al.add("1"); al.add("13"); int size = al.size(); 问题1:索引越界异常Exception in thread "main"…
删除库的时候报错 ERROR: database "temp_test_yang" is being accessed by other usersDETAIL: There are 4 other sessions using the database. 说明该temp_test_yang库正在被人连接.解决方法是: 查询出连接该数据库的进程,并将其杀死(比较暴力) select pg_terminate_backend(pid) from pg_stat_activity wh…
public static void main(String[] args) { ArrayList<String> list = new ArrayList<String>(Arrays.asList("a", "b", "c", "d")); for (int i = 0; i < list.size(); i++) { list.remove(i); } System.out.println…