Problem Statement is-
In this case inclusion is null, and exclusion has some values, So I need to check whether temp is there in exclusion, if temp is there in exclusion then don't do anything or you can just get out of the loop, but suppose temp is not there in exclusion then call some method. I implemented the same feature below not sure whether we can improve this more or not. As it looks to me we can improve this more without using any boolean stuff I guess. As the stuff in main needs to be in a method and it is going to be called lot of times
public static void main(String[] args) {
String temp = "77"; // It can also be 0
String inclusion = null;
String exclusion = "100;77;71";
boolean bb = false;
if(inclusion !=null) {
System.out.println("Site Inclusion is not null");
} else {
for (String exc: exclusion.split(";")) {
if(exc.equals(temp)) {
bb =true;
break;
}
}
if(!bb) {
// Call some method
}
}
}