Example
public class
ClassA {
private boolean
a;
private boolean
x;
private boolean
y;
public
ClassA () {
a=true;
x=true;
y=false;
if (!a && !b || !c) {
System.out.println("Test");
}
}
Solution
In the given example, the if statement's expression can be simplified and be made faster with the following change:
public class
ClassA {
private boolean
a;
private boolean
x;
private boolean
y;
public
ClassA () {
a=true;
x=true;
y=false;
if (!(a || b && c)) {
System.out.println("Test");
}
}