create a array code example

Example 1: string array in java methods

String[] vowels = { "a", "e", "i", "o", "u" };
System.out.println(vowels);
System.out.println(Arrays.toString(vowels));

Example 2: how to create array in javascript

/* 
	Array class is a global object that is used
    in the construction of arrays
    
    See - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
*/
let array_1 = new Array(2);
	arr.push("James");
	arr.push("Fred");

let array_2 = ["James", "Fred"];

Example 3: how to create an array in javascript

let myVar = ["1","2","3"];

Example 4: arrays

//Javascript Array
var fruitList = ["Bananas", "Apples", "Oranges"]

Example 5: how to declare an array

redim Friday(NumFRdays)

Tags:

Misc Example