When I use this I get no output to the file. Lock Are you sure that numOfElements is being set to the length of your array?
Or that your array is even populated in the first place? The array is just a parameter and i populate it in main. There's no reason it shouldn't work. Set a couple breakpoints and check it out from there. Yea I am not sure it just makes a new file but does not display anything — Lock Show 1 more comment. Zhurov Konstantin Zhurov Konstantin 1 1 gold badge 8 8 silver badges 14 14 bronze badges. Tonny Madsen Tonny Madsen Sign up or log in Sign up using Google. Sign up using Facebook.
Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science.
Stack Gives Back Surely you want to use prvky[i][j] because j will hold the values from zero to the length of prvky[i]. There might not be j elements within prvky. But there are several other issues with this code aswell: As the doc states: FileWriter is meant for writing streams of characters. And write is inherited from OutputStreamWriter and as the doc states, public void write int c throws IOException Writes a single character. Paul Paul So something like this if you use Integers: writer.
In fact it is because: public void write int c Writes a single character. But you need this: public void write String str Writes a string. Leah Leah 3 3 silver badges 13 13 bronze badges. Its using writer. There's an error in the code. The inner for loop always reads the length of the first array element, but then refers to other members of that array which are likely to have a different length.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related Hot Network Questions. Question feed. Learn more. Asked 9 years, 3 months ago. Active 2 years, 7 months ago. Viewed 44k times. Edward Sullen.
Edward Sullen Edward Sullen 1 1 gold badge 5 5 silver badges 18 18 bronze badges. What have you tried? Hello Edward, welcome to SO. Please choose a valid answer if your question has been answered, thanks : — m0skit0. Add a comment. Active Oldest Votes. What should I do? Provide the charset used by your file - typically, something like Charset. Note that he wants each line to be an entry in the array, not broken up by tokens within the line. You should have your text1.
Sorry, I forgot mention that i'm developing android app. Will it be the same path as normal Java App?
0コメント