What is the exact difference between out.write() and out.print()

后端 未结 9 620
情深已故
情深已故 2020-12-13 20:49

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

9条回答
  •  眼角桃花
    2020-12-13 21:31

    out.write(-) vs out.print(-)

    One more difference is out.write(-) method just write data or object to browser like a file. You can not write any statement like out.write(10*20); but we do this with out.print(10*20);

提交回复
热议问题