title: Common method for printing arrays and lists of any types
body: <p>Whenever I am debugging a piece of code which involves arrays or lists of ints, doubles, strings, etc/, I prefer printing them over sometimes. What I do for this is write overloaded printArray / printList methods for different types.</p>
  
  <p>for e.g.</p>
  
  <p>I may have these 3 methods for printing arrays of various types</p>
  
  <pre><code>public void printArray(int[] a);
  
  public void printArray(float[] b);
  
  public void printArray(String[] s);
  </code></pre>
  
  <p>Though this works for me, I still want to know whether it is possible to have a generic method which prints arrays/lists of any types. Can this also be extended to array/list of objects.</p>