Computer Science, asked by 6Shivam92, 1 year ago

What is an array? Write a statement to declare an integer array of 10 elements.

Answers

Answered by chandansinha1
21
Array is a set of homogeneous data elements (similar name and data) stored in a contiguous memory location

class Chandan
{
public static void main()
{
int[] number={1,2,3,4,5,6,7,8,9,10};
System.out.println(number [1]);
}
}
output will be:
2
since it counts from 0

vidhitiwari15: hello
aryak27: hii
vidhitiwari15: hlo
aryak27: hii
vidhitiwari15: what
vidhitiwari15: oo sorry
Similar questions