Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 KB | None | 0 0
  1. import java.util.Collections;
  2. /**
  3.  *
  4.  * @author Dalen Jones
  5.  *
  6.  */
  7. public class Plant implements Comparable {
  8.     private String name;
  9.     private double price;
  10.     /**
  11.      * Constructs the plant class
  12.      * @param theName the name of the plant
  13.      * @param thePrice the price of the plant
  14.      */
  15.     public Plant(String theName, double thePrice) {
  16.         setName(theName);
  17.         setPrice(thePrice);
  18.        
  19.     }
  20.     /**
  21.      * Sets the name of the plant
  22.      * @param theName the name of the plant
  23.      */
  24.     public void setName(String theName) {
  25.         name = theName;
  26.     }
  27.     /**
  28.      * Sets the price of the plant
  29.      * @param thePrice the price of the plant
  30.      */
  31.     public void setPrice(double thePrice) {
  32.         price = thePrice;
  33.     }
  34.     /**
  35.      * Gets the name of the plant
  36.      * @return name the name of the plant
  37.      */
  38.     public String getName() {
  39.         return name;
  40.     }
  41.     /**
  42.      * Gets the price of the plant
  43.      * @return price the price of the plant
  44.      */
  45.     public double getPrice() {
  46.         return price;
  47.     }
  48.     public int compareTo (Object otherObject) {
  49.         return 0;
  50.     }
  51.    
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement