I have an array as shown below.
Basically in this array, sometimes thebagdata[i].getSecurityType() may or may not contain values in an array.
for (int i = 0; i <bagdata.length; i++) {
if (bagdata[i].getSecurityType() != null) {
flag = true;
} else {
flag = false;
}
}
I think that my code is overriding the flag value. How can I deal with this?
Depend on what you want to flag, try: