I wrote the following line of code for a Java 8
project:
Comparator<Person> oldestPerson= Comparator.comparing(Person::getOldestBirthday);
It is a simple comparator, however I am trying to use this code In a project that only uses Java 7
, therefore giving this error:
"Method references are not supported at this language level"
I understand im getting the error as im not using Java 8. Is there a simple way to re-write the logic without having to use a method reference?