Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
tFlowToIterate iterates on the input data and generates global variables.
eg:
int[] values = new int;
// Loop over all the elements in the values array
for (int i=0; i<values.length; i++) {
// Do something with values, such as print it
System.out.println( values );
}
OR
eg:
// Find-Max
// Given a non-empty array of ints, returns
// the largest int value found in the array.
// (does not work with empty arrays)
public int findMax(int[] nums) {
int maxCounter = nums; // use nums as the max to start
// Look at every element, starting at 1
for (int i=1; i<nums.length; i++) {
if (nums > maxCounter) {
maxCounter = nums;
}
}
return maxCounter;
}