You can do it by stream
.
List<Integer> vars = new ArrayList<>();vars.add(a);vars.add(b);if (vars.stream().noneMatch(v -> v == 0)) { // No variable = 0. Do something} else { // Do something}
You can do it by stream
.
List<Integer> vars = new ArrayList<>();vars.add(a);vars.add(b);if (vars.stream().noneMatch(v -> v == 0)) { // No variable = 0. Do something} else { // Do something}