Question: NEEDS TO BE WRITTEN IN JAVA >> THANK YOu 5. (6 pts) A class named Part has two fields: category (int) and cost (double). Write
NEEDS TO BE WRITTEN IN JAVA >> THANK YOu

5. (6 pts) A class named Part has two fields: category (int) and cost (double). Write a single Comparable compare To method that orders Part objects by ascending categories and by ascending cost within each category. For example: 2 12.96 2 45.12 2 87.00 2 100.38 2 253.93 10 34.12 10 34.98 10 294.23 10 3467.89
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
