I'm trying to make a shallow copy of a HashSet of Points called myHash. As of now, I have the following:
HashSet<Point> myNewHash = (HashSet<Point>) myHash.clone();
This code gives me an unchecked cast warning however. Is there a better way to do this?
You can try this:
HashSet<Point> myNewHash = new HashSet<Point>(myHash);