title: how to print a string array in a method
body: <p>I'm trying to do a program that stores names in na array and a method that will print that array however the method is not working and I don't know what is wrong here's my code: </p>
  
  <pre><code>//method to print array
  public static String printName(String[] name){
  
        for(int i=0; i&lt;names.length; i++){
                return names[i];
        }
  }
  
  public static void main(String[] args){
      String[] names = {"jack"};
      printName(names);
  }
  </code></pre>