Question: how arrays work in java?
Answer: Arrays in Java work differently than they do in C/C++. ... The variables in the array are ordered and each have an index beginning from 0. Java array can be also be used as a static field, a local variable or a method parameter. The size of an array must be specified by an int value and not long or short.