-1
Comparator<Employee> comparator =Comparator.comparing(Employee::getIncome);
Employee minObj= Employee.persons().stream()
                       .min(comparator)
                       .get();

This is returning me address instead of an object.

toMap.Employee@66133adc

What is the problem and how to write it correctly?

Pranjal
  • 31
  • 3

1 Answers1

0

It probably isn't—you have forgotten to override toString().

Behrang
  • 46,888
  • 25
  • 118
  • 160