Ukázkový příklad - program

public class Hrad {
    private String nazev;
    private Collection<Strasidlo> strasidla;

    public String getNazev() { return nazev; }
    public void setNazev(String n) { nazev = n; }
    public Collection<Strasidlo> getStrasidla() { return strasidla; }
    public void setStrasidla(Collection<Strasidlo> s) { strasidla = s; }
}
public class DruhStrasidla {
    private String nazev;

    public String getNazev() { return nazev; }
    public void setNazev(String n) { nazev = n; }
}
public class Strasidlo {
    private Hrad hrad;
    private String nazev;
    private DruhStrasidla druhStrasidla;

    public Hrad getHrad() { return hrad; }
    public void setHrad(Hrad h) { hrad = h }
    public String getNazev() { return nazev; }
    public void setNazev(String n) { nazev = n; }
    public DruhStrasidla getDruhStrasidla() { return druhStrasidla; }
    public void setDruhStrasidla(DruhStrasidla d) druhStrasidla = d; }
}
 
www.softeu.cz
< 9/26 >