Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

initilize an array java

type var-name[];
OR
type[] var-name; 
//examples:
int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 };
OR
int[] arr;
arr = new int[5]; //size declared
String[] arr2=new String[5]; //quick initialization with size declaration
 
PREVIOUS NEXT
Tagged: #initilize #array #java
ADD COMMENT
Topic
Name
4+5 =