how to initialize an array in java

Solutions on MaxInterview for how to initialize an array in java by the best coders in the world

showing results for - "how to initialize an array in java"
William
23 Apr 2019
1int[] data = {10,20,30,40,50,60,71,80,90,91};
2// or
3int[] data;
4data = new int[] {10,20,30,40,50,60,71,80,90,91};
5// or
6int[] data = new int[10];
7data = {10,20,30,40,50,60,71,80,90,91};
Russ
20 Nov 2016
1int[] data = {10,20,30,40,50,60,71,80,90,91};
2
3// or
4
5int[] data;
6data = new int[] {10,20,30,40,50,60,71,80,90,91};
7
Claudio
03 Oct 2017
1int[] array=new int[5];
2int[] array2=new int[]{1,2};
queries leading to this page
array defination javajava declare initialize arrayinitialize empty array java initialising an array in javajava arra initializationinitialize int array in javajava initialize array with valuesintialize array javahow to initialize an array javahow to declare and initialize an array in javajava array initializeationinitial i array in javajava set int array java initialise arrayhow to declare and initialize array in javahow to initialize an arrayinitialize an array javahow to initialize an array in jvaadefine integer array in javaarray define in javainitialize an array in javadeclare and initialize array in javajava declare array and initializejava array initializationhow initslise an array in javacreate and initialize array in javajava int array initializationhow to initialize a new array javajava intialise arrayinitialize int array javajava initialize arrayjava inicialize int arrayhow to initialize array of int in javahow to initiate array in javainitialise array javahow to initialize an int array in javaint array java initializeinitialize new int array javahow to initialise an array in javahow initilize arry in javainitializa array javajava declare array initializehow to initialize an array in javainitializing array in javainitialzing an array in javajava initialzie array array initialization javajava how to initialise an arrayarray initialization in javainitialize array with value javainitialize java array with valuesinitialize int array java in javainitialize new array javainitialiser array javainitialize arrays javahow to initialize a int array in javaarray with initial values javainit array with elements javajava create 26 initialize an arrayinitialize array in javahow to initialize a array in javainitialize arrayinstantiate an array javainitializing arrays in javajava initialize array integercreate and initialize array javainstantiate array javainitializing arrayshow to inzialize an arrayjava array initializerarray initialization syntax javainit array in javaarray java initationhow to initialise array in javainit an array javajava initializing arrayhow to initialize array in java in java util arraysjava declare 26 initialize arrayjava initialisalise int arrayjava array initialisationinitialise array in javahow to initialize user deffine an array in javajava initialize int arraydeclare 2c instatiate and initialize array in javahow to properly instantiate an array in javahow to initialize array in javainitialise an array in javainstantiate an array in javahow to instantiate an array in javainitializing an array in javainitialize array javahow to initialize an array in java