Results 1 to 4 of 4
  1. #1
    nikos6707 is offline Member
    Join Date
    Sep 2011
    Posts
    5
    Rep Power
    0

    Unhappy Write 2d array into file

    Hello everyone.
    I have create a 2d array that contains integers. I want two write this array into file. I don't know the length of the integers. Could anyone help me with this problem?
    P.S. I want the format of the data into the file be like a 2d array.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: Write 2d array into file

    Java Code:
    loop
      loop
        write array element
        write whitespace
      end loop
      write newline
    endloop
    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default Re: Write 2d array into file

    Not at all a Jave2D question. Moving to New to Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    waiheng1986 is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default Re: Write 2d array into file

    You are able to know the 2d array size by using the function from the integer class.

    such as,
    Java Code:
    int[ ][ ] intArray = new int[5][3];
    //size of the 2d array
    int sizeOfArray = intArray.length;
    // and then you just doing some looping and find for the 1d array

Similar Threads

  1. Replies: 1
    Last Post: 10-09-2011, 06:57 PM
  2. Replies: 3
    Last Post: 10-07-2011, 12:39 AM
  3. how to write the String Array into the own file
    By nirasiva in forum New To Java
    Replies: 2
    Last Post: 06-16-2011, 07:13 AM
  4. Replies: 6
    Last Post: 12-01-2010, 05:31 AM
  5. How to write text file into Array
    By venkat.ravala in forum New To Java
    Replies: 13
    Last Post: 11-19-2009, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •