I am just learning how to call arrays through methods and I know how to do it when they are integers, however, my teacher did not go through too much on what to do with Strings. I figured they weren't much different, overall same concept, however I keep getting an error incompatable type message. I am trying to return three dog names to my main method, but it's not working. I would love if someone could explain what I'm doing wrong here so I could better grasp this concept.
private static Scanner input = new Scanner(System.in);
public static void main(String[] args)
{
String dogs2[] = new String[3];
dogTypes(dogs2);
for(int i =0; i < dogs2.length; i++)
{
System.out.printf("\nDog Type %d: %s", i+1, dogs2);
}
}
public static String dogTypes(String dogs[])
{
System.out.printf("\nPlease enter 3 dog types: ");
{
for(int i =0;i < dogs.length; i++)
dogs[i] += input.nextLine();
}
return dogs;
}