Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. package teszt;
  2.  
  3. import java.util.HashSet;
  4. import java.util.Set;
  5.  
  6. public class A {
  7.  
  8.  
  9. public static void main(String[] args) {
  10. Set hashSet = new HashSet();
  11.  
  12. for(short i = 1; i <= 100; ++i) {
  13. hashSet.add(i);
  14. hashSet.remove((short)(i-1));
  15. }
  16.  
  17. System.out.println("HashSet size: " + hashSet.size());
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement