This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I wrote the above program. Output is true and false. Why for line# 1 output is true. Since Dog class does not implement hashCode and Equals method, Object's class hashCode will be used which returns different no for any input value. So, search in bucket different from where the elementwas stored should lead to element not found. Please tell where I am wrong. Thanks, Garima