Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab1;
- import java.util.*;
- public class Lab1
- {
- private static Random rand = new Random();
- public static void main(String[] args)
- {
- HashSet<String> hs = new HashSet<String>();
- System.out.println("Список до: ");
- hs.add("Кроты");
- hs.add("Хомяки");
- hs.add("Лопаты");
- System.out.println(hs);
- HashSet<String> subSet = new HashSet<String>();
- subSet.add("Мудаки");
- subSet.add("Тёлки");
- hs.addAll(subSet);
- System.out.println("Список после:");
- System.out.println(hs);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement