class EnumComSwitch {
private static enum MeuEnum {
NEW, CHANGE, DELETE, BLABLA;
}
public static void main
(String[] args
) { MeuEnum elemento = MeuEnum.CHANGE;
switch (elemento) {
case NEW:
System.
out.
println("Este é o NEW"); break;
case CHANGE:
System.
out.
println("Este é o CHANGE"); break;
case DELETE:
System.
out.
println("Este é o DELETE"); break;
case BLABLA:
System.
out.
println("Este é o BLABLA"); break;
}
}
}
Y2xhc3MgRW51bUNvbVN3aXRjaCB7CiAgICBwcml2YXRlIHN0YXRpYyBlbnVtIE1ldUVudW0gewogICAgICAgIE5FVywgQ0hBTkdFLCBERUxFVEUsIEJMQUJMQTsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgTWV1RW51bSBlbGVtZW50byA9IE1ldUVudW0uQ0hBTkdFOwogICAgICAgIHN3aXRjaCAoZWxlbWVudG8pIHsKICAgICAgICAgICAgY2FzZSBORVc6CiAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkVzdGUgw6kgbyBORVciKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlIENIQU5HRToKICAgICAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiRXN0ZSDDqSBvIENIQU5HRSIpOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgREVMRVRFOgogICAgICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCJFc3RlIMOpIG8gREVMRVRFIik7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSBCTEFCTEE6CiAgICAgICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkVzdGUgw6kgbyBCTEFCTEEiKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KfQ==