P
Paul.Lee.1971
Hi,
I'm very new to Java and would like to ask a newbie question: are
strings automatically null terminated? If I invoke
a class of my own as follows;
MyCoords location = new MyCoords("21.5 N 57.0", "Boeing 747",
"S265W");
are the arguments in parentheses in the constructor automatically
appended implicitly with \0 ?
The reason why I ask is that the first argument in the constructor can
be either a set of points or an area,
and I'm trying to populate a String array of size [2][2], all
initialised to 0. If the first argument is a set of points, I need
only populate
the first two elements of the array. If not, all 4 must be populated.
Ideally, I'd loop through the first argument in
the constructor until \0 is reached, but I don't know if this is added
to the end.
Many thanks
Paul
I'm very new to Java and would like to ask a newbie question: are
strings automatically null terminated? If I invoke
a class of my own as follows;
MyCoords location = new MyCoords("21.5 N 57.0", "Boeing 747",
"S265W");
are the arguments in parentheses in the constructor automatically
appended implicitly with \0 ?
The reason why I ask is that the first argument in the constructor can
be either a set of points or an area,
and I'm trying to populate a String array of size [2][2], all
initialised to 0. If the first argument is a set of points, I need
only populate
the first two elements of the array. If not, all 4 must be populated.
Ideally, I'd loop through the first argument in
the constructor until \0 is reached, but I don't know if this is added
to the end.
Many thanks
Paul