You can declare an array like this: dataType[] myArray;
The array must be explicitly allocated with the new operator:
myArray = new dataType[numberOfElements];
The number inside the brackets is size of the array. Once you create the array, you cannot update the size of the array later on. You can initialize elements of an array in several different ways.
Please Subscribe for more Java tutorial videos coming soon
On this page of the site you can watch the video online Creating an Array in Java - How to Declare and Initialize Arrays Easy Tutorial - Appficial with a duration of hours minute second in good quality, which was uploaded by the user Appficial 29 November 2017, share the link with friends and acquaintances, this video has already been watched 10,155 times on youtube and it was liked by 107 viewers. Enjoy your viewing!