Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- Student st1 = new Student("Petkan", 20);
- Student st2 = new Student("Dragan", 30);
- Student st3 = new Student("Petkan", 20);
- Student st4 = st1;
- Console.WriteLine(st1.GetHashCode());
- Console.WriteLine(st2.GetHashCode());
- Console.WriteLine(st3.GetHashCode());
- Console.WriteLine(st4.GetHashCode());
- Console.WriteLine(st1.Equals(st2));
- Console.WriteLine(st1.Equals(st3));
- Console.WriteLine(st1.Equals(st4));
- HashSetMy<int> hs = new HashSetMy<int>();
- hs.AddItem(10);
- hs.AddItem(20);
- hs.AddItem(30);
- hs.AddItem(40);
- hs.AddItem(50);
- hs.AddItem(50);
- hs.AddItem(60);
- hs.Remove(30);
- Console.WriteLine(string.Join(" ", hs));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement