String data = "<html>";
data += "<body>";
data += "ID:" + id;
data += "<br>";
data += "Password:" + pw;
data += "</body>";
data += "</html>";
out.print(data);
I don't understand this part.
In the first line, <html>
was added to the String type data.
I connected all the strings with data += below that, then
data = data + "<body>"
data = data + "ID:"+ id
It's connected like this, right?
where data += overrides all data in each row, so
Eventually, if you say out.print(data) at the end, if you don't turn the forword, the data value is substituted at the end.
Shouldn't only </html>
be printed?
String data = "qwe";
data += "asd";
// data = data + equal to "asd"
In the code above, data+="asd"
does not refer to "asd" as "asd", but rather to connect "asd" to "qwe" already assigned to the data.
Therefore:
System.out.println(data); // qweasd 출력
That's what happens.
© 2024 OneMinuteCode. All rights reserved.