Horje
Lists - removing with iterator Code Example
Lists - removing with iterator
List<String> names = new ArrayList<>(List.of("John Doe", "Jack Doe", "John Smith"));
Iterator<String> it = names.iterator();
while (it.hasNext()) {
    String name = it.next();
    if (name.startsWith("John")) {
        it.remove();
    }
}
Source: github.com




Java

Related
List Double, fixed size Code Example List Double, fixed size Code Example
zweidimensionales array ausgeben java Code Example zweidimensionales array ausgeben java Code Example
calculate the area of two squares in java by using  a method Code Example calculate the area of two squares in java by using a method Code Example
core java mcq Code Example core java mcq Code Example
how to clear cli screen Code Example how to clear cli screen Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7