Array exercises#
Question
Given an array consisting of the numbers between zero and ten. What are the second, fifth and eighth values in the array? How would you print them?
- While this is a perfectly valid way of initializing array, it would be inefficient if we wanted to initialize an array of, say, 100 values. Look at the ImageJ macro docs and try to understand what the function
Array.getSequence()
does.
Question
It is a bit cumbersome to print an array element by element. Can't we print the whole array directly? Try using Array.print()
rather than simply print()
.
Question
Try initializing some arrays of various types. Can you mix types in an array?