I want to output a boolean as true indicating both maps have same Key and values. If i use equals() it returns false. How can i output as true , Object references are different. But the entries are same I have 2 maps below
Map<String,Information> map1=new HashMap<>();
map1.put("key1", new Information("10","20","30","40"));
map1.put("key2", new Information("11","22","33","44"));
Map<String,Information> map2=new HashMap<>();
map2.put("key1", new Information("10","20","30","40"));
map2.put("key2", new Information("11","22","33","44"));
POJO as below : with public getters and setters
public class Information {
private String value1;
private String value2;
private String value3;
private String value4;
public Information(String value1,
String value2,
String value3,
String value4)
{
this.value1 = value1;
this.value2 = value2;
this.value3 = value3;
this.value4 = value4;
}
}