Posted By

indecs on 08/20/15


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

indecs


[note] Printing Array in Java


 / Published in: Java
 

URL: http://stackoverflow.com/questions/16217452/why-wont-my-array-print-out-correctly

Must use deepToString() to print elements in an array.

Reference(old-toString()): http://stackoverflow.com/questions/16217452/why-wont-my-array-print-out-correctly

  1. import java.util.Arrays;
  2. public class Practive{
  3. public static void main (String[] args)
  4. {
  5. int [][] array = {{3,4,5},{6,7,8}};
  6. System.out.println(Arrays.deepToString(array));
  7.  
  8. }
  9.  
  10. }

Report this snippet  

You need to login to post a comment.