Class Apple
Object
Apple
- All Implemented Interfaces:
Comparable<Apple>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
compareTo1
(Apple rhsApple) Place your code for comparing Apples by size here.int
compareTo2
(Apple rhsApple) Place your code for comparing Apples by type here.int
compareTo3
(Apple rhsApple) Place your code for comparing Apples by color here.getColor()
int
getSize()
getType()
static void
toString()
-
Field Details
-
size
public int size -
type
-
color
-
-
Constructor Details
-
Apple
-
-
Method Details
-
getSize
public int getSize() -
getType
-
getColor
-
compareTo
- Specified by:
compareTo
in 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
-