Class Apple

Object
Apple
All Implemented Interfaces:
Comparable<Apple>

public class Apple extends Object implements Comparable<Apple>
  • Field Details

    • size

      public int size
    • type

      public String type
    • color

      public AppleColor color
  • Constructor Details

  • Method Details

    • getSize

      public int getSize()
    • getType

      public String getType()
    • getColor

      public AppleColor getColor()
    • compareTo

      public int compareTo(Apple rhsApple)
      Specified by:
      compareTo in interface Comparable<Apple>
    • compareTo1

      public int compareTo1(Apple rhsApple)
      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

      public int compareTo2(Apple rhsApple)
      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

      public int compareTo3(Apple rhsApple)
      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

      public String toString()
      Overrides:
      toString in class Object
    • main

      public static void main(String[] args)