首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

java.lang.StringIndexOutOfBoundsException: String index

2011-11-13 
编译正确,但运行时报错具体的代码就不贴了,错误信息是java.lang.StringIndexOutOfBoundsException:Stringi

编译正确,但运行时报错
具体的代码就不贴了,错误信息是

java.lang.StringIndexOutOfBoundsException:   String   index   out   of   range:   0
                at   java.lang.String.charAt(Unknown   Source)
                at   BasicPostFixInterpreter.solve(BasicPostFixInterpreter.java:674)
                at   BasicPostFixInterpreter.openConfirm(BasicPostFixInterpreter.java:360)

                at   BasicPostFixInterpreter.access$100(BasicPostFixInterpreter.java:215)
                at   BasicPostFixInterpreter$2.actionPerformed(BasicPostFixInterpreter.jav
a:262)
                at   javax.swing.AbstractButton.fireActionPerformed(Unknown   Source)

。。。。

不知道是什么原因

private   String   inputText;
if   (inputText.charAt(0)   ==   '% ')   return   ;

这样的代码没有什么问题吧。



[解决办法]
最好还是把代码贴出来
[解决办法]
那偶只能JF了......

热点排行