Strings – Oracle documentation and tutorial

     String str = "abc";

is equivalent to:

     char data[] = {'a', 'b', 'c'};
     String str = new String(data);

https://docs.oracle.com/javase/7/docs/api/java/lang/String.html

https://docs.oracle.com/javase/tutorial/java/data/strings.html

Strings are constant; their values cannot be changed after they are created.

getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)

Copies characters from this string into the destination character array.

See the tutorial above to see how the getChars String method can be used to create an array of char from a string, and the array can then be used to make a new string, thus in effect copying a string.

But also see this String method:

toCharArray() Converts this string to a new character array.

The different ways to declare an array in Java

 

The following from:

 https://docs.oracle.com/javase/specs/jls/se7/html/jls-10.html

The [] may appear as part of the type at the beginning of the declaration, or as part of the declarator for a particular variable, or both.

For example:

byte[] rowvector, colvector, matrix[];

This declaration is equivalent to:

byte rowvector[], colvector[], matrix[][];