srikotesh
asked on
how do i compare an object based on two fields
Student object
fname,
lastname,
Address,
i want to compare student object with combination first name and last name
how many ways we can what is the best approach to do it?
fname,
lastname,
Address,
i want to compare student object with combination first name and last name
how many ways we can what is the best approach to do it?
What do you mean (in plain English) by 'compare'?
ASKER
I may have 100 students object
I have to compare and I have to take unique objects
I have to compare and I have to take unique objects
Student should already have an ID. Does it not have one?
Incidentally, i asked my last question because 'comparing' in Java suggests sorting, not examining difference or equality. The latter is implemented by equals()
If you don't have an ID, you should ask yourself
a. what happens if you have two students called "John Smith"?
b. what happens if you have two students called "John Smith" at the same address (improbable but not impossible)
Incidentally, i asked my last question because 'comparing' in Java suggests sorting, not examining difference or equality. The latter is implemented by equals()
If you don't have an ID, you should ask yourself
a. what happens if you have two students called "John Smith"?
b. what happens if you have two students called "John Smith" at the same address (improbable but not impossible)
ASKER
i want to compare an object based on two fields
it doesn't have any unique id
by combinatin of two fieds it will be a unique
for sample i took student object
if i have 100 objects those 100 should be unique objects only
it doesn't have any unique id
by combinatin of two fieds it will be a unique
for sample i took student object
if i have 100 objects those 100 should be unique objects only
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.