作者:韭花帖_420 | 来源:互联网 | 2023-09-16 15:19
这是代码,我该怎么做才能将开关替换为11级语言上可用的功能?
private final int MAX_AUTORES = switch (this.getclass().getSimpleName()) {
case "Artigo","Resumo" -> 8;
case "Minicurso" -> 3;
case "Monografia","Palestra" -> 1;
case "RelatorioTecnico" -> 4;
default -> throw new IllegalStateException("Valor inesperado: " + this.getclass().getSimpleName());
};