Is there a way i can put a variable into value of a text box.

Ex.
String var ="XYZ";
.
.
.
.
<input name="ABC" value=var > //this doesnt work.
....