Advertisement
punidota

Untitled

Feb 27th, 2016
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. package lab1;
  2. import java.util.*;
  3.  
  4. public class Lab1
  5. {
  6.     private static Random rand = new Random();
  7.     public static void main(String[] args)
  8.     {
  9.         HashSet<String> hs = new HashSet<String>();
  10.         System.out.println("Список до: ");
  11.         hs.add("Кроты");
  12.         hs.add("Хомяки");
  13.         hs.add("Лопаты");
  14.         System.out.println(hs);
  15.         HashSet<String> subSet = new HashSet<String>();
  16.         subSet.add("Мудаки");
  17.         subSet.add("Тёлки");
  18.         hs.addAll(subSet);
  19.         System.out.println("Список после:");
  20.         System.out.println(hs);
  21.  
  22.     }  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement