I\'m trying to segment my current output of code into seperate lines of 8. What
ID: 3872642 • Letter: I
Question
I'm trying to segment my current output of code into seperate lines of 8. What can I add to my current code to make this happen?
My code is reading from a txt file with lines of integers, and each has a space between them. The data from the text file looks like the following:
My current output is one singular line that looks like this:
I'm looking for this:
Here is my code thus far that is generating the output (What can be added to it to segment the data into 8 for each line?):
0 001 000 0 1 10 1 001 1 1 0 1 1 0 1 0 0Explanation / Answer
The desired out put can be obtained from adding/inserting new line in between each iteration in the while loop.
Either use System.out.println(F.next()); or System.out.print(F.next()+"ln");
instead of
System.out.print(F.next());