当前位置:网站首页>Difference between JSP out.print() and out.write() methods
Difference between JSP out.print() and out.write() methods
2022-08-02 00:18:00 【qq_25073223】
From:
JSP outDifference between .print() and out.write() methods
The following describes the difference between the out.print() and out.write() methods, as follows:
Introduction to out.print() and out.write() methods
out.print() and out.write() methods in JSPAll belong to the methods of the abstract subclass JspWriter of the abstract class Writer;The out.print() method belongs to the method in the abstract subclass JspWriter,And out.write() is a method of the parent class Writer.-------------------------------------------------out.print(): The method in the JspWriter class is calledout.writer(): calls the method in its parent Writer class
The difference between the two methods:1. The print method is a subclass of JspWriter, and write is a method defined in the Writer class. 2. The overloaded print method can convert various types of data into strings.The form of output, and the overloaded write method can only output character-related data such as characters, character arrays, and strings. The JspWriter type out object can output strings using both the print method and the write method. 3. If the value of the string objectWhen it is null, the print method will output a string with the content "null" and the write method will throw a NullPointerException exception Example
Output numbers
<% out.print(98); %>
<% out.write(98); %>-----Run the above code, it will output different information---98-----------------b
边栏推荐
猜你喜欢
随机推荐
20220725 Information update
为什么要使用MQ消息中间件?这几个问题必须拿下
After an incomplete recovery, the control file has been created or restored, the database must be opened with RESETLOGS, interpreting RESETLOGS.
GIF making - very simple one-click animation tool
Arduino 基础语法
Artifact XXXwar exploded Artifact is being deployed, please wait...(已解决)
基于超参数自动寻优的工控网络入侵检测
玩转NFT夏季:这份工具宝典值得收藏
How to solve the error when mysql8 installs make
IP核:FIFO
security CSRF漏洞保护
How to reinstall Win11?One-click method to reinstall Win11
ES中SQL查询详解
els block deformation
在CentOS下安装MySQL
【Leetcode】478. Generate Random Point in a Circle(配数学证明)
Axure教程-新手入门基础(小白强烈推荐!!!)
QML包管理
security 会话并发管理
async和await用法介绍









