How to create and use Array in Java?

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:
How to create and use Array in Java?
how to create array in r
Advertisements
how to create array in python
difference between java5 and java6 - Java Beginners
How to create dynamic array in C?
Java2
about java1
how to create a zip by using byte array
Maven dependency for com.gooddata - gooddata-http-client version 1.0.0+java7 is released. Learn to use gooddata-http-client version 1.0.0+java7 in Maven based Java projects
How to create binary search tree using an array?
Create Array ??
How to create a long array with the help of long buffer.
Javah
How to Create a ByteBuffer using Byte Array in java.
create and use an array variable in a java program
create dynamic array in javascript
javaa swings - IDE Questions
how to use button in array
create associative array from array javascript
Create array of random size
Create list from array in Java
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-alpha05 is released. Learn to use plugins-javax-inject version 2.0.0-alpha05 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-alpha04 is released. Learn to use plugins-javax-inject version 2.0.0-alpha04 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-alpha03 is released. Learn to use plugins-javax-inject version 2.0.0-alpha03 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-alpha02 is released. Learn to use plugins-javax-inject version 2.0.0-alpha02 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-alpha01 is released. Learn to use plugins-javax-inject version 2.0.0-alpha01 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0 is released. Learn to use plugins-javax-inject version 2.0.0 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-rc2 is released. Learn to use plugins-javax-inject version 2.0.0-rc2 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-rc1 is released. Learn to use plugins-javax-inject version 2.0.0-rc1 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-beta01 is released. Learn to use plugins-javax-inject version 2.0.0-beta01 in Maven based Java projects
Maven dependency for com.episode6.mockspresso2 - plugins-javax-inject version 2.0.0-alpha06 is released. Learn to use plugins-javax-inject version 2.0.0-alpha06 in Maven based Java projects
About Java2
Create an array of 5 doubles...
create a string from an array using JavaScript
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.16 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.16 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.9 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.9 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.11 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.11 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.10 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.10 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.15 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.15 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.14 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.14 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.13 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.13 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.12 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.12 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.8 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.8 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.7 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.7 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.6 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.6 in Maven based Java projects
Maven dependency for io.yupiik.uship - servlet-jakarta-javax-bridge version 1.0.5 is released. Learn to use servlet-jakarta-javax-bridge version 1.0.5 in Maven based Java projects
Java create new array of strings.
create python array of size n
Javap Tool application
Create a int array with the help of int buffer.

Ads