Create an array code example
Example 1: arrays in java
int[] intArray = new int[20];
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
Example 2: how to use arrays java
public static void main(String[] args)
{
int[] arrNum = {25, 23, 15, 20, 24};
for(int a = 0; a < arrNum.length; a++)
{
System.out.println(arrNum[a]);
}
}
Example 3: string array in java methods
String[] vowels = { "a", "e", "i", "o", "u" };
System.out.println(vowels);
System.out.println(Arrays.toString(vowels));
Example 4: Java create array of array
String[][] arrays = new String[][] { array1, array2, array3, array4, array5 };
Example 5: how to create an array in javascript
let fruits = ['Apple', 'Banana']
console.log(fruits.length)
Example 6: arrays in java
int[] arr;
arr = new int[N];