String str = Integer.toString(int i);toString
public static String toString(int i)Returns a new String object representing the specified integer. The argument is converted to signed decimal representation and returned as a string, exactly as if the argument and radix 10 were given as arguments to the toString(int, int) method.
Parameters:
i - an integer to be converted.
Returns:
a string representation of the argument in base 10.
public static String toString(int i)Returns a new String object representing the specified integer. The argument is converted to signed decimal representation and returned as a string, exactly as if the argument and radix 10 were given as arguments to the toString(int, int) method.
Parameters:
i - an integer to be converted.
Returns:
a string representation of the argument in base 10.
String s_int = Integer.toString(i);
javax.servlet.ServletException: start
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at _0002fsubmit_0002ejspsubmit_jsp_1._jspService(_0002fsubmit_0002ejspsubmit_jsp_1.java:146)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java
int endnum=Integer.parseInt("end");
int abortnum=Integer.parseInt("abort");这样能行吗?
肯定报异常啊?
从字符串 "start", "end" 中得到 int?????
把 "start", "end" 两边的引号去掉。
String k=i+"";
这样就可以把int转换为String类型了
String a1= Integer.toString(i);