Wednesday, 7 August 2013

Java ArrayLists not equal even though they are

Java ArrayLists not equal even though they are

Hi I have two ArrayList which has HashMap stored in it. For e.g
expectedList = [
{
id = 1, key = X, rowid = 1, id = 1, timeofday = 12: 12: 00,
stream = A
},
{
id = 999999999, key = Y, rowid = 2, id = 1, timeofday = 16: 12: 00,
stream = A
}]
tableList = [
{
id = 1, key = X, rowid = 1, id = 1, timeofday = 12: 12: 00,
stream = A
},
{
id = 999999999, key = Y, rowid = 2, id = 1, timeofday = 16: 12: 00,
stream = A
}]
expectedFileList.equals(tableList) //returns false any idea why? Data is
exactly same in both lists even order is same still it returns false.
Please guide. Thanks in advance.

No comments:

Post a Comment