HI i have problem in removing cat can you guys help me. how do i remove 1 cat.
package com.codegym.task.task08.task0819;
import java.util.HashSet;
import java.util.Set;
import java.util.Iterator;
/*
Set of cats
*/
public class Solution {
public static class Cat{
public Cat(){
}
}
public static void main(String[] args) {
Set<Cat> cats = createCats();
cats.remove(new Cat());
//write your code here. step 3
printCats(cats);
}
public static Set<Cat> createCats() {
//write your code here. step 2
Set<Cat> set = new HashSet<Cat>();
set.add(new Cat());
set.add(new Cat());
set.add(new Cat());
return set;
}
public static void printCats(Set<Cat> cats) {
// step 4
for(Cat cat : cats){
System.out.println(cat);
}
}
// step 1
}