In my servlet I gave both out.print and out.write. but both prints in the browser.
What is the exact difference between these two and when
PrintWriter:
public void write(String s)
Write a string. This method cannot be inherited from the Writer class because it must suppress I/O exceptions.
print method has higher level of abstraction.
public void print(String s)
Print a string. If the argument is null then the string "null" is printed. Otherwise, the string's characters are converted into bytes according to the platform's default character encoding, and these bytes are written in exactly the manner of the write(int) method.
Hope this helps.