Class Apple
Object
Apple
- All Implemented Interfaces:
Comparable<Apple>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintcompareTo1(Apple rhsApple) Place your code for comparing Apples by size here.intcompareTo2(Apple rhsApple) Place your code for comparing Apples by type here.intcompareTo3(Apple rhsApple) Place your code for comparing Apples by color here.getColor()intgetSize()getType()static voidtoString()
-
Field Details
-
size
public int size -
type
-
color
-
-
Constructor Details
-
Apple
-
-
Method Details
-
getSize
public int getSize() -
getType
-
getColor
-
compareTo
- Specified by:
compareToin interfaceComparable<Apple>
-
compareTo1
Place your code for comparing Apples by size here.- Parameters:
rhsApple- Apple object that is on the right-hand side- Returns:
- int result of comparison
-
compareTo2
Place your code for comparing Apples by type here.- Parameters:
rhsApple- Apple object that is on the right-hand side- Returns:
- int result of comparison
-
compareTo3
Place your code for comparing Apples by color here.- Parameters:
rhsApple- Apple object that is on the right-hand side- Returns:
- int result of comparison
-
toString
-
main
-