Welcome to Westonci.ca, where you can find answers to all your questions from a community of experienced professionals. Get immediate and reliable answers to your questions from a community of experienced experts on our platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.
Sagot :
The declaration and initialization of arrays involves creating and using the arrays
How to declare an array?
Assume the programming language is Java.
To declare and initialize an array, we make use of:
- One dimensional array: Data-Type Array-name [] = {List of array values}
- Two dimensional array: Data-Type Array-name [] [] = {List of array values}
Assume the array name of the one dimensional array is num, and the data type is integer.
The following can be used to declare and initialize the array to have 5 elements
int num [] = {1,2,3,4,5}
Assume the array name of the two dimensional array is num, and the data type is integer.
The following can be used to declare and initialize the array to have 2 rows and 3 columns
int num [][] = {{1,2},{3,4},{5,6}}
Read more about arrays at:
https://brainly.com/question/22364342
Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Get the answers you need at Westonci.ca. Stay informed by returning for our latest expert advice.