We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Arrays

alanmin
alanmin asked
on
Medium Priority
171 Views
Last Modified: 2010-03-30
Is there anyway of sending a 2-d array to a file????
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
What i really need to know though is how to send it to a file.

Commented:
You didn't specify what kind of array it is. Is it an array of
primative types, or object? In either case, you can use a DataOutputStream ans just iterate through the tow arrays:

for( int i= 0; i < array.length; i++ )
{
      for( int j = 0; j < array[i].length; j++ )
      {
            ostream.writeInt( array[i][j] );
      }
}

Author

Commented:
got it sorted anyway ta!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.