interface Subdivision {
int numberOfEmployers();
}
class Workshop implements Subdivision {
@Override
public int numberOfEmployers() {
// тут должна быть реализация интерфейса
}
}
class Department implements Subdivision {
@Override
public int numberOfEmployers() {
// тут должна быть реализация интерфейса
}
}
class Service {
public static void main(String[] args) {
Workshop workshop1 = new Workshop();
Department department1 = new Department();
// some code
int sum1 = getFoodCost(workshop1);
int sum2 = getFoodCost(department1);
}
public static int getFoodCost(Subdivision subdivision) {
return subdivision.numberOfEmployers() * 300;
}
}
Stage stage = (Stage) someElementOfTheWindow.getScene().getWindow();