Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java delete element from list

List<String> list = new ArrayList<>();
list.add("Hello World");

String removedStr = list.remove(0); // returns the removed element
boolean removeByElement = list.remove("Hello World"); // true if the element was deleted successfuly
Source by www.journaldev.com #
 
PREVIOUS NEXT
Tagged: #java #delete #element #list
ADD COMMENT
Topic
Name
2+3 =