I want a brief definition about the equals() , \"==\" and hashCode(). If i run following code means the output will be \"true false 2420395 2420395\". But i had understand that
equals() only compare string it's does not check reference of string
but '==' check reference and data both
in 1st case String str = "Name"; only one object is created but in
2nd case Two object is created
String str1 = new String("Name");
then reference are not same of both string that means it returns false