在比较其他文件中的函数时找不到类

时间:2017-01-26 16:45:37

标签: java collections

我有这行代码:

SortedSet<Person> personenArray = new TreeSet<>
(Comparator.comparingInt(Person::getWeight()));

我有一个班级Person,其中包含getWeight()方法,但它告诉我Person cannot be resolved to a variable并且找不到方法getHeight()

我做错了什么?

0 个答案:

没有答案