Reputation: 8400
I have a multi-dimensional array with 5 rows and 5 columns. The first 5 rows are social issues. The user has to enter an integer value rate each social issue from a scale 1(lease important) to 10(very important).
How can I output the data to a table?
for (int col = 1; col < poller[row].length; col++) {
poller[row][col] = input.nextInt();
}
Upvotes: 2
Views: 117
Reputation: 32391
This will print your data to the console.
int length = poller.length;
for (int row = 0; row < length; row++) {
int rowLength = poller[row].length;
System.out.println("");
for (int col = 0; col < rowLength; col++) {
System.out.print(poller[row][col]);
}
}
Upvotes: 1