How do I format my output as a 4-by-4 matrix? : <pre><code>class By
{
public static void main(String args[]) throws InterruptedException {
String key = "Hello world";// plaintext
byte[] x = key.getBytes();
StringBuilder sb = new StringBuilder();
for (int i = 0; i &lt; x.length; i++) {
int b = (int) x[i];
sb.append(Integer.toHexString(b));
}
System.out.println(sb.toString());
}
}
This program output is: 48656c6c6f20776f726c64
I need my output to be a 4-by-4 matrix as such:
                      1st row is:: 48   6f   72   00
                      2nd row is:: 65   20   6c   00
                      3rd row is:: 6c   77   64   00
                      4th row is:: 6c   6f   00   00
</code></pre>

<p>How do I write code for this in java?Please anyone show me the code to get my required output.</p>
