> (1) what are these brackets for,
They indicate that you want an array of that type of object.
Contrast string x and String []y.
x can only hold one string. y can hold n strings, where n is set when
you initialize the array.
> (2) do you ever put anything inside them,
Yes. just like when you initialize a single object, you need to
initialize arrays to a given size.
so, using the examples above,
x = new String(); // Allocates space for 1 string and sets it to ""
y = new String[5]; // Allocates space for 5 strings. Does not set any
of them
> (3) do they only go after the word "String",
No, you can have an array of any type, including the fundamental types
(int, char, double,...)
> and (4) are you supposed to have a space before the [] or not?
Coder's preference. The Java compiler ignores whitespace. Use whatever
looks good to you.