I am having problem with List Object values. Object is an object of class which holding two integer number.
like
List<Object> container;
container.Add(new Coordinates(x_axis, y_axis)); // x_axis=200, y_axis=300
I have to add unique coordinates each time, means next time x_axis, y_axis can never be added to list if it is 200, 300 respectively.
How can I check the already exist item in list objects?
Thanks
Override Equals and GetHashCode for your Coordinates class:
And use generic List or HashSet of your Coordinates objects:
And with HashSet: