What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-14 07:17:24
when to use collections in java
LIST: Can store duplicate values, Keeps the insertion order. It allows multiple null values, Also we can read a certain value by index. - ArrayList not syncronized, array based class - LinkedList not synchronized, doubly linked - Vect... Add solution -
Other 2021-11-12 04:31:07
TreeSet
import java.util.*; // Declare the variable using the interface of the object for flexibility. // Non-primative data types only. Set<String> movies = new TreeSet<String>(); movies.add(E); // TreeSet will be sorted by element. // Work with an... Add solution -
Java 2021-10-20 23:48:05
TreeSet addAll() method in java
import java.util.Iterator; import java.util.TreeSet; public class TreeSetAddAllMethodExample { public static void main(String[] args) { TreeSet<Integer> ts1 = new TreeSet<Integer>(); TreeSet<Integer> ts2 = new TreeSet&l... Add solution