Пример #1
0
  public static void main(String[] args) {

    Building b = new Building();
    b.area = 1000;
    b.location = "Hrasnicka 17";
    b.population = 1000;

    University u = new University();
    u.area = 500;
    u.location = "Butmirska 100";
    u.population = 1200;
    u.name = "IUS";
    u.isItPublic = false;
    u.numberOfFaculties = 3;
    u.numberOfStaff = 200;
    System.out.println(u.getPopulationDensity());
    u.printInformation();

    Hospital h = new Hospital();
    h.area = 200;
    h.location = "Vrbanja 12";
    h.population = 50;
    h.hasCTMachine = false;
    h.isItPublic = false;
    h.numberOfSurgeons = 20;
    h.numberOfBeds = 20;
    System.out.println(h.getPopulationDensity());

    Jail j = new Jail();
    j.area = 2000;
    j.location = "Grbavicka 12";
    j.population = 1600;
    j.hasGym = true;
    j.numberOfCells = 800;
    j.numberOfFreeCells = 0;
    j.securityLevel = "Max";
    System.out.println(j.getPopulationDensity());
    System.out.println(j.getNumberOfOccupiedCells());
  }