Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package teszt;
- import java.util.HashSet;
- import java.util.Set;
- public class A {
- public static void main(String[] args) {
- Set hashSet = new HashSet();
- for(short i = 1; i <= 100; ++i) {
- hashSet.add(i);
- hashSet.remove((short)(i-1));
- }
- System.out.println("HashSet size: " + hashSet.size());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement