Answers for "how to create and initialize array in java"

10

how to initialize array in java

int[] arr = new int[5];	 // integer array of size 5 you can also change data type
Posted by: Guest on May-15-2020
1

java how to initialize an array

int[] numbers = new int[5]; /* size of the array is 5 */
int[] nums = new int[] {1, 2, 3, 4, 5}; /* Fill the array ny these numbers*/
String[] names = new String[10]; /* array of type string and size 10 */
String[] countries = new String[] {"Germany", "US"};
Posted by: Guest on June-17-2021

Code answers related to "how to create and initialize array in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language