当前位置:网站首页>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
边栏推荐
猜你喜欢
TCL: Pin Constraints Using the tcl Scripting Language in Quartus
在CentOS下安装MySQL
mysql8安装make报错如何解决
20220725 Information update
security CSRF漏洞保护
How to solve the error when mysql8 installs make
Play NFT summer: this collection of tools is worth collecting
How to get the best power efficiency in Windows 11?
Short video SEO search operation customer acquisition system function introduction
Unity—四元数、欧拉角API+坐标系统
随机推荐
Study Notes: The Return of Machine Learning
短视频SEO优化教程 自媒体SEO优化技巧方法
Unity—四元数、欧拉角API+坐标系统
【无标题】
security session concurrency management
146. LRU 缓存
以交易为生是一种什么体验?
After an incomplete recovery, the control file has been created or restored, the database must be opened with RESETLOGS, interpreting RESETLOGS.
Using the "stack" fast computing -- reverse polish expression
[头条]笔试题——最小栈
An interesting project--Folder comparison tool (1)
接地气讲解TCP协议和网络程序设计
基于编码策略的电网假数据注入攻击检测
Axure教程-新手入门基础(小白强烈推荐!!!)
在CentOS下安装MySQL
Short video SEO optimization tutorial Self-media SEO optimization skills and methods
How to reinstall Win11?One-click method to reinstall Win11
【Leetcode】470. Implement Rand10() Using Rand7()
【Leetcode】478. Generate Random Point in a Circle(配数学证明)
扑克牌问题