2023-04-13 16:07:52 +03:00
|
|
|
package lab4;
|
|
|
|
|
|
2023-05-11 16:10:42 +03:00
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
2023-04-13 16:07:52 +03:00
|
|
|
public class Main {
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
//todo equals+hashcode
|
2023-05-11 16:10:42 +03:00
|
|
|
// todo JavaDoc
|
|
|
|
|
Furniture[] furnitureArray = {
|
|
|
|
|
new Furniture("A", 1, 1, 1, 1),
|
|
|
|
|
new Furniture("D", 1, 1, 1, 4),
|
|
|
|
|
new Furniture("B", 1, 2, 1, 1),
|
|
|
|
|
new Furniture("C", 1, 1, 3, 1),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Arrays.sort(furnitureArray, (o1, o2) -> o1.getMaterial().compareTo(o2.getMaterial()));
|
|
|
|
|
// todo print
|
|
|
|
|
|
|
|
|
|
// todo check
|
|
|
|
|
Arrays.sort(furnitureArray, (o1, o2) -> Integer.compare(o2.getPrice(), o1.getPrice()));
|
2023-04-13 16:07:52 +03:00
|
|
|
}
|
|
|
|
|
}
|