give the output of int a[]=new int [5];
a[0]=4; a[1]=8; a[2]=7; a[3]=12; a[4]=3;
System.out.println(a[2+1]);
Answers
Answered by
5
Answer:
give the output of int a[]=new int [5];
a[0]=4; a[1]=8; a[2]=7; a[3]=12; a[4]=3;
System.out.println(a[2+1]);
Explanation:
i.nt a[]=ne.w; a[0]=10;initi.aliz.ation; a[.1]=20; a[ 2]=70;a[3]=40, a[4]=50;tra.versi.ng ar.ray; f.or in.t i=0 .
Answered by
0
Answer - In attachment
Java array is an object which contains elements of a similar data type. Additionally, The elements of an array are stored in a contiguous memory location. It is a data structure where we store similar elements. We can store only a fixed set of elements in a Java array.
Attachments:



Similar questions