34 lines
716 B
Java
Raw Normal View History

2021-02-10 15:11:44 -05:00
public class Flower extends Plant {
2021-02-13 11:05:55 -05:00
private boolean isAnnual;
2021-02-10 15:11:44 -05:00
private String color;
2021-02-13 11:05:55 -05:00
public Flower () {
super();
this.isAnnual = false;
this.color = "TBD";
}
public void setPlantType(boolean isAnnual){
this.isAnnual=isAnnual;
}
public boolean getPlantType(){
return this.isAnnual;
}
public void setColorOfFlowers(String color){
this.color=color;
}
public String getColorOfFlowers(){
return this.color;
2021-02-10 15:11:44 -05:00
}
@Override
public void printInfo(){
System.out.println("Plant Information:");
System.out.println("\tPlant name: " + name);
System.out.println("\tCost: " + cost);
System.out.println("\tAnnual: " + isAnnual);
System.out.println("\tColor of flowers: " + color + "\n");
}
}