Answers for "how to make an array"

13

java int array

int[] theNumbers = new int[5];

arr[0] = 4;
arr[1] = 8;
arr[2] = 15;
arr[3] = 16;
arr[4] = 23;
arr[5] = 42;
Posted by: Guest on February-18-2020
33

how to declare array java

int intArray[];    //declaring array
intArray = new int[20];  // allocating memory to array
//OR
int[] intArray = new int[20]; // combining both statements in one
Posted by: Guest on February-21-2020
32

how to create an array in java

int[] array1 = new int[5]; //int array length 5
String[] array2 = new String[5] //String array length 5
double[] array3 = new double[5] // Double array length 5
Posted by: Guest on January-28-2020
4

how to declare an array in javascript

var array = [item1, item2, .....];
/*

  item1 and item2 could be a string (which is 
  a letter written in double or single quotes like this "string" or 'string') or 
  a number (which is just a normal number on the keypad) or a boolean (which is 
  an experssion which either returns to true of false) and the ..... means that 
  the inputs can be infinite.
  
*/
Posted by: Guest on July-23-2021
2

how to create an array in javascript

let myVar = ["1","2","3"];
Posted by: Guest on December-04-2020
3

how to make a array in javascript

//Im using a let type variable for the example because it's what i reccomend

let exampleArray = ["Example", "Lorem Ispum Dolor", "I think you've got it"]

//Here's how you select a single object in the list

exampleArray[1] 

/*In Javascript the arrays start counting at 0 which means i selected the 2nd
object in the list(Lorem Ispum Dolor) so if i wanna select the first array i
must type*/

exampleArray[0]

/*Now let's say you want to display it on the console, like let's say you are 
coding in Node.js and you wanna see the value of the array.
P.S: In the example im gonna show all the values of the array.*/

console.log(exampleArray[0, 1, 2]
Posted by: Guest on October-07-2020

Code answers related to "how to make an array"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language