array

pts.
Tags:
J2EE
Java
i want to know how to add the two dimensional array .(if possible explain me with example)

Answer Wiki

Thanks. We'll let you know when a new response is added.

I’m not sure that I quite understand your question — are you wishing to create a two dimensional array? If so, then it depends whether or not you are wishing to create an array of Objects or of primitives:

// declares a 5×5 arrays of int and each element is set to 0
public int intArray[5][5];

// declare a 5×5 array of Strings; each element then needs
// to be set

public String stringArray[5][5];
stringArray[0][0]=”Some String”;

Of course, the above is assuming you want a rectangular array, if you want to have an array where each row can be different lengths, you go about it differently.

Can you give explain your question in more detail?

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following