C
conrad
I have overriden toString in one of my classes
I craft a String object there much like this:
output = "Some text.\n"
output += "Some more text.\n";
output += "And some more text.\n";
return output;
In another class I create a PrintWriter
object and do the following for
an object of the class where I have
toString overriden:
printWriterObject.println(objectOfMyClass);
and upon looking at the text file that was
output all the new lines have been stripped
except the last that would correspond to
the use of println. Is this normal?
I craft a String object there much like this:
output = "Some text.\n"
output += "Some more text.\n";
output += "And some more text.\n";
return output;
In another class I create a PrintWriter
object and do the following for
an object of the class where I have
toString overriden:
printWriterObject.println(objectOfMyClass);
and upon looking at the text file that was
output all the new lines have been stripped
except the last that would correspond to
the use of println. Is this normal?