Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to initialize an array in java

int[] data = {10,20,30,40,50,60,71,80,90,91};
// or
int[] data;
data = new int[] {10,20,30,40,50,60,71,80,90,91};
// or
int[] data = new int[10];
data = {10,20,30,40,50,60,71,80,90,91};
Comment

java how to initialize an array

int[] arr = new int[10];	//Can hold 10 elements
Comment

how to initialize array in java

int[] arr = new int[5];	 // integer array of size 5 you can also change data type
Comment

java array initialization

int[] data = {10,20,30,40,50,60,71,80,90,91};

// or

int[] data;
data = new int[] {10,20,30,40,50,60,71,80,90,91};
Comment

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"}; 
Comment

initialize an array in java

int[] array=new int[5];
int[] array2=new int[]{1,2};
Comment

java initialize int array

int[] arr = new int[n];
Comment

How to Initialize Arrays in Java?

//declare and initialize and array
int[] age = {12, 4, 5, 2, 5};
Comment

PREVIOUS NEXT
Code Example
Java :: date format in java 
Java :: Java print class type 
Java :: arrays in java 
Java :: java how to convert string to int 
Java :: spring boot save file to static folder 
Java :: random in java a to b 
Java :: maven paper 
Java :: java parseint 
Java :: java replace first occurrence of substring 
Java :: last char in string java 
Java :: java string replace character at position 
Java :: java switch case 
Java :: android application class 
Java :: java time difference 
Java :: java get relative path 
Java :: javac celar 
Java :: android view set border programmatically 
Java :: how to update java on windows 10 
Java :: sum of array elements java 
Java :: java replace character 
Java :: how to take max value from priority queue in java 
Java :: java print type of variable 
Java :: print array 
Java :: initialize a new class java 
Java :: number format java 
Java :: java object to int 
Java :: java indexof all occurrences 
Java :: java datatypes 
Java :: java program to remove duplicate words in a string 
Java :: spring boot param object 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =