What is an array? Write a statement to declare an integer array of 10 elements.
Answers
Answered by
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
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
Similar questions
History,
7 months ago
Science,
7 months ago
Physics,
1 year ago
Sociology,
1 year ago
India Languages,
1 year ago