import java.util.LinkedList;결과:
public class RemoveElement {
public static void main(String[] args) {
LinkedListllist = new LinkedList ();
llist.add("o1");
llist.add("o2");
llist.add("o3");
llist.add("o4");
llist.add("o5");
System.out.println("삭제 전: "+llist);
부울 b = llist.remove("o2");
// 존재하고 성공적으로 삭제된 경우 true를 표시합니다
System.out.println("deleted item: "+b);
System.out.println("삭제 후(첫 번째): "+llist);
}
}
삭제 전: [o1, o2, o3, o4, o5]
삭제된 항목: true
삭제 후(첫 번째): [o1, o3, o4, o5]
Please disable your ad blocker and refresh the window to use this website.