How to initialize an array in Java?
The above is not correct (syntax error). It means you are assigning an array to data[10] which can hold just an element. If you want to initialize an array, try using Array Initializer: Notice the difference between the two declarations. When assigning a new array to a declared variable, new must be used. Even if … Read more