== compares the references. If you want to compare the references use, == and if you want to compare the contents, use equals().