Hi, I'm learning java, I'm doing a program where the user can enter several names with their birthday but I'm stuck because I want to print the list of names that I previously asked and put in an array using a scanner but I get this when I run the program at the end when I want to print the entire array. [Ljava.lang.String;@880ec60[Ljava.lang.String;@880ec60[Ljava.lang.String;@880ec60[Ljava.lang.String;@880ec60[Ljava.lang.String;@880ec60
here is my code:
import java.util.Scanner;
public class birthday {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
String[] words = new String[5];
for (int i = 0; i < words.length; i++) {
System.out.println("Birthday name?");
words[i] = input.next();
}
for (int i = 0; i < words.length; i++){
System.out.print(words.toString());
Here I created an array with 5 to put the 5 names asked and use a cycle to ask 5 times and if it was to print the same thing, try using another cycle to print the array of names but the same thing was still happening can someone help me please, thank you.