The toString() method of the array returns a String describing the identifier of the array, not its contents. This is because arrays do not override Object.toString() , whose documentation explains what you see:
The toString method for the Object class returns a string consisting of the name of the class whose object is the instance, the at-sign `@ 'character and the hexadecimal representation of the unsigned hash code of the object. In other words, this method returns a string equal to the value:
getClass().getName() + '@' + Integer.toHexString(hashCode())
To get a view of the String array, you can use Arrays.toString(Object[]) .
The String returned by this method consists of representing each toString() element in the order they appear in the array and is enclosed in square brackets ( "[]" ). Adjacent elements are separated by a comma and a space ( ", " ).
For example, calling this method in your array will result in the following String :
"[Einstein, , Newton, , Copernicus, , Kepler.]"
Note that double commas and odd distance are due to the fact that your String array element already has punctuation and a space in them. Removal:
String [] genius = {"Einstein", "Newton", "Copernicus", "Kepler"};
Then the method returns this String :
"[Einstein, Newton, Copernicus, Kepler]"
It is important to note that using this method does not give you any control over the formatting of the resulting String . . This is useful for quickly checking the contents of an array, but it is limited beyond the scope of this goal. For example, what if you do not need those that enclose square brackets, or want to list each item in turn?
At this point, you should see the value of implementing your own method to display the contents of your array in a way that is specific to your task. As others suggested, practice this with a for loop and create a new resulting String that you want to output.
You can find more information about for loops in this Java Tutorials article . All in all, Java Tutorials are great reading for a beginner and should accompany your course well.