To get the size of LinkedHashSet, use the size() method.
First, set the LinkedHashSet and add elements:
LinkedHashSet<Integer> set = new LinkedHashSet<Integer>(); set.add(10); set.add(20); set.add(30); set.add(40); set.add(50); set.add(60);
Display the size of the LinkedHashSet created above:
For more info go through our : https://www.tutorialspoint.com/index.htm
No comments:
Post a Comment