package Lecture12; public class PlantTest { public static void main(String[] args) { Plant p= new Plant("PGenus", "PSpecies", false); Tree t= new Tree("TGenus", "TSpecies", 15.0, 2.0); Flower f= new Flower("FGenus", "FSpecies", "rojo", true); Rose r= new Rose(1.0, "RGenus", "RSpecies", "amarillo"); Pine pi= new Pine("PiGenus", "PiSpecies", 10.0, 1.0, "delgado", "grueso"); System.exit(0); } } class Plant { private String kingdom; private String genus; private String species; private boolean annual; public Plant(String g, String s, boolean a) { kingdom= "Plantae"; genus= g; species= s; annual= a; } } class Tree extends Plant { private double crownSize; private double trunkSize; public Tree(String g, String s, double cs, double ts) { super(g, s, false); crownSize= cs; trunkSize= ts; } } class Flower extends Plant { private String blossomColor; public Flower(String g, String s, String bc, boolean a) { super(g, s, a); blossomColor= bc; } } class Rose extends Flower { private double thornDensity; public Rose(double td, String g, String s, String bc) { super(g, s, bc, false); thornDensity= td; } } class Pine extends Tree { private String needleType; private String coneType; public Pine(String g, String s, double cs, double ts, String nt, String ct) { super(g, s, cs, ts); needleType= nt; coneType= ct; } }