1. A reference to the moving object was put in the bag. When the moving object changes its position, the original location is no longer in the bag. So, the first countOccurrences prints 0, and the second prints 1.
2. To handle searching for a null target.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here