This assignment reviews arrays in Java. The problem isto write code that prints the values stored in an array callednames backwards, and also write code that sets each element of aboolean array called flags to alternating values ( true at index 0,false at index 1,etc.) Thank You!! This assignment reviews arrays in Java. The problem isto write code that prints the values stored in an array callednames backwards, and also write code that sets each element of aboolean array called flags to alternating values ( true at index 0,false at index 1,etc.) Thank You!!
Explanation / Answer
write code that prints the values stored inan array called names backwards Object[] names; for(int i= names.length-1; i >= 0;i--) { System.out.println(names[i]); } write code that sets each element of a boolean arraycalled flags to alternating values ( true at index 0, false atindex 1,etc.) boolean[]flags; for(int i= 0; i