What is the compare() method?
Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.
What is the compare() method?
Rating:
The compare() method is a method of the RecordComparator interface. It is used to compare two values in a record store for sorting. The general syntax of this method is as follows:
Here, the rec1 parameter denotes the value of the first record to be compared.
The rec2 parameter denotes the value of the second record to be compared.
This comparison returns one of the following predefined integer values:
- EQUIVALENT
- PRECEDES
- FOLLOWS
Rating:
Was this information helpful?
Other articles
- What is the Spacer class?
- What is the setMediaTime() method?
- What is the getFilter() method?
- What is the getConstraints() method?
- What is the getNumRecords() method?