问个关于print与write的问题
package test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class test extends HttpServlet{
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws
IOException,
ServletException {
response.setContentType( "text/html;charset=GBK ");
PrintWriter out = response.getWriter();
int obj;
obj = 1;
out.print(obj);
}
}
_______________________________________________________________________
如上代码,若将out.print换成是out.write,则输出的并不是1,而是这样 的一个符号,这是什么原因呢.
------解决方案--------------------鍥犱负鍐欏嚭鏉ョ殑鏄瓧绗︼紝灏辨槸char