Section 17.3 Initializing Arrays
We must initialize any variable before using it. The same holds true for arrays. The various methods are discussed in the Codecast below.
If you cannot see this codecast, please click here.
Check Your Understanding Check Your Understanding
2.
Please declare and initialize an array of five integers and store the values 2, 7, 4, 9, -5 in the array (in this order). You should name your array "arr" and not modify any of the code to print out the array’s contents. Be sure to declare any additional variables needed.
When your program performs correctly you’ll be given a keyword to enter in Canvas.