Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Collections;
- /**
- *
- * @author Dalen Jones
- *
- */
- public class Plant implements Comparable {
- private String name;
- private double price;
- /**
- * Constructs the plant class
- * @param theName the name of the plant
- * @param thePrice the price of the plant
- */
- public Plant(String theName, double thePrice) {
- setName(theName);
- setPrice(thePrice);
- }
- /**
- * Sets the name of the plant
- * @param theName the name of the plant
- */
- public void setName(String theName) {
- name = theName;
- }
- /**
- * Sets the price of the plant
- * @param thePrice the price of the plant
- */
- public void setPrice(double thePrice) {
- price = thePrice;
- }
- /**
- * Gets the name of the plant
- * @return name the name of the plant
- */
- public String getName() {
- return name;
- }
- /**
- * Gets the price of the plant
- * @return price the price of the plant
- */
- public double getPrice() {
- return price;
- }
- public int compareTo (Object otherObject) {
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement