Answers for "java flag"

1

java flag

Inside the loop use this code only:

isFound = (a[i] == valueToRemove);
if (isFound) {
    a[i] = 0;
    break;
}
isFound is the flag and it gets true if the array item a[i] is equal to valueToRemove.
If this flag is true it changes the value of the item to 0 enter code hereand exits the loop.
I used a for the array, change it to the name of your variable.
I guess arraySize is a variable holding the size of the array.
Posted by: Guest on March-22-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language