+ 1
What is the best way to create an array?
FORM 1- // Create an array of integers with the ability to store 5 items int[] n = new int[5]; // Initialize the array by assigning each position a unique value n[0] = 2; n[1] = 56; n[2] = 777; n[3] = 0; n[4] = -55; FORM 2 (array literal)- // Declare and initialize an array int[] n = {2, 56, 777, 0, -55};
5 Answers
+ 4
Juan Debenedetti I just looked this up for you hope it helps
https://www.homeandlearn.co.uk/java/java_arrays.html
+ 4
look in the array section of the Java fundamental tutorial
https://www.sololearn.com/learn/Java/2148/
+ 4
Juan Debenedetti you can always go to the code playground of past codes and select language and type in - like in this case array or arrays and see how others have used them in their codes directly... use their experience as your guide.
+ 2
BroFarOps Thanks!
+ 1
BroFarOps yes, I understand the issue of arrays well, I wanted a more personal response.