My question is how I could align the elements of an array so that they are aligned to the right.
This is the code I had done so far:
for (int i=0; i < matrix.length; i++)
{
System.out.print("|");
for (int j=0; j < matrix[i].length; j++)
{
System.out.print(" " + matrix[i][j] + " ");
}
System.out.print("|");
System.out.println();
}
Thanks for your response.