问题是我有这个方法createNode()在树中创建一个节点,然后如果它是一个离开节点,它将它添加到一个ArrayList<Tree> treeLeaves,我在浏览treeLeavesArrayList 时调用这个方法,如下所示:
Iterator<Tree> iter = treeLeaves.iterator();
while (iter.hasNext()) {
iter.next().createNode();
}
Run Code Online (Sandbox Code Playgroud)
或者像这样:
For (Tree cursor : treeLeaves) {
cursor.createNode();
}
Run Code Online (Sandbox Code Playgroud)
但我一直有这个例外:
Exception in thread "main" java.util.ConcurrentModificationException
Run Code Online (Sandbox Code Playgroud)
即使把下面的代码放在一起snychronized(treeLeaves){}.PS:我不知道这是否有用但是; 这是一棵n树.
我对此代码有疑问:
$(document).ready(function() {
sweetAlert("a");// This is just a test, and it runs successfully by the way!!!
});
$("#login").keyup(check);
function check() {
$(this).val($(this).val().replace(/\s/g,"_"));
}
Run Code Online (Sandbox Code Playgroud)
浏览器正在加载文件,我从检查器中检查了它,并运行.ready脚本。但是它不能与.keyup一起使用。然后当我复制/粘贴行
$("#login").keyup(check);
Run Code Online (Sandbox Code Playgroud)
在控制台中,它可以成功运行。
如果需要,这是html表单:
<input type="text" name="login" id="login"/>
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助。