How to create and use Array in Java?

Hi,

How to create and use Array in Java?

Write program to construct and use the array.

Thanks

View Answers

April 16, 2017 at 6:21 PM

Hi,

You can initialize the int array in following way:

int num[] = new int[10];

Above example code initializes an array with a capacity of 10. After initializing the array you can store data like this:

num[0]=10;
num[1]=11;

etc..

You can read complete example at Array in Java.

Thanks









Related Tutorials/Questions & Answers:
Advertisements