C# Programming
04-03-2009, 02:11 PM
I have implemented class using IComaprer where in compareto method has been used.
I have 2 objects and say i have date field in both set as march 20 2009 in both objects.
Let there be name field in both in first case it is Amit and second it is Ajay
Now i sort these 2 on date. first time i get Amit as first record and Ajay as second record. I say ******* and call sort again than i get Ajay first and Amit second. Cant i get same sequence everytime as date value on which sort is being done is same in both objects
I have 2 objects and say i have date field in both set as march 20 2009 in both objects.
Let there be name field in both in first case it is Amit and second it is Ajay
Now i sort these 2 on date. first time i get Amit as first record and Ajay as second record. I say ******* and call sort again than i get Ajay first and Amit second. Cant i get same sequence everytime as date value on which sort is being done is same in both objects