20 lines
517 B
Java
20 lines
517 B
Java
public class Flower extends Plant {
|
|
private String isAnnual;
|
|
private String color;
|
|
|
|
public Flower(String name, String cost, String isAnnual, String color){
|
|
super(name, cost);
|
|
this.isAnnual = isAnnual;
|
|
this.color = color;
|
|
}
|
|
|
|
@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");
|
|
}
|
|
}
|