Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

How to create and use Array in Java?

Ads

 
 

Share on Google+Share on Google+

Java Coder
How to create and use Array in Java?
1 Answer(s)      2 months and 8 days ago
Posted in : Java Beginners

Hi,

How to create and use Array in Java?

Write program to construct and use the array.

Thanks

Ads
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


Ads