I'm getting the following error when I attempt to compile:
Error in com/codegym/task/task08/task0819/Solution.java on line 3
cannot find symbol
symbol: class Cat
location: package com.codegym.task.task04.task0403
What's going on? Is it not detecting that I created the Cat class?
package com.codegym.task.task08.task0819;
import com.codegym.task.task04.task0403.Cat;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
/*
Set of cats
*/
public class Solution {
public static void main(String[] args) {
Set<Cat> cats = createCats();
//write your code here. step 3
cats.remove(1);
printCats(cats);
}
public static Set<Cat> createCats() {
//write your code here. step 2
Cat cat1 = new Cat();
Cat cat2 = new Cat();
Cat cat3 = new Cat();
Set<Cat> setCats = new HashSet<Cat>();
setCats.add(cat1);
setCats.add(cat2);
setCats.add(cat3);
return setCats;
}
public static void printCats(Set<Cat> cats) {
// step 4
Iterator<Cat> iter = cats.iterator();
while(!cats.isEmpty()){
while(iter.hasNext()){
System.out.println(iter.next());
}
}
}
// step 1
public static class Cat{
public Cat(){
}
}
}