title: String[] cannot be converted to String
body: <p>So I'm writing a program where i ask the user to enter size of array and fill it with names. Later i ask user to type number and the program will search array for names that have length. However i keep getting a incompatible type error. String[] cannot be converted to string.</p>
  
  <pre><code>package LAB4_1;
  
  import java.util.Arrays;
  import java.util.Scanner;
  
  public class LAB4_1
  
  {
  
  public static void main(String[] args)
  {
      Scanner sc = new Scanner(System.in);
      String names [];
      int length_typed;
      String names_printed; 
  
      // Read the number of kids
      System.out.print("How many kids are there? ");
      int size = sc.nextInt();
  
      // Read the names of the kids
      String [] kids = new String [size];
  
      for (int k = 0; k &lt; kids.length; k++)
      {
          System.out.print("Enter name of kid #" + k + ": ");
          kids[k] = sc.next();
      }
      // Print all the names of the kids and the length of their names
      System.out.println("Names of kids with lengths are: ");
  
      for (int i = 0; i &lt; kids.length; i++)
      {
        System.out.println(kids[i] + " " + kids[i].length());
      }
  
      // Prompt for sequence of name lengths:
        System.out.print("Enter lengths of names as promted, 0 to terminate.");
  
      // Read the lengths and print list of names till 0 is entered
        length_typed = sc.nextInt();
  </code></pre>
  
  <p>The error is here</p>
  
  <pre><code>      names_printed = LAB4_1.filterByLength(names, length_typed);
  </code></pre>
  
  <p>String[] cannot be converted to String. Am i not calling the method correctly?</p>
  
  <pre><code>      System.out.println(names_printed);
  
  }
  
  /**
   * Count the number of names in an array that have a certain length
   * @param names: An array of names
   * @param length : an integer length
   * @return the number of names in the array whose length is given
   */
  
  static int countByLength(String [] names, int length)
  {
  int count = 0;
  
  for(int i = 0;i &lt; names.length;i++)
  {
    if(names[i].length() == length) 
        count++;
  }
  
  
  return count;
  }
  
  
  /**
   * Filter an array of names and keep only those names with a given length
   * @param names: an array of names
   * @param length: an integer length
   * @return the array of names that have the given length
   */
  static String [] filterByLength(String [] names, int length)
  {
      String [] filtered = new String[countByLength(names, length)];
      int index = 0;
  
      for(int k = 0; k &lt; filtered.length; k++)
      {
          if(names[k].length() == length) filtered[index++]=names[k];
      }
  
      return filtered; 
  }
  </code></pre>
  
  <p>}</p>