• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

My code saves 2D wrongly

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Help please I need my code to write 2D array to a text file also read from text. I manage to get it to store in the arraylist... so the characters are in the format
BBRRL
BBBBB
LLLBB
which are rows and columns. but when I try to keep it in the array list it prints the characters upside down so I use a trick which I think is wrong my printing j before i... it is suppose to be i before j. doing that it came out the way i wanted it... but when i save the file and look how it is stored in the text file i see different thing... even worst than what was in the arraylist.

here are my codes... and please can someone help me write a read method... to read from a text file into the 2d array. thanks.



 
Look ma! I'm selling my stuff!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic