java parseexception_Java开发网 - 请教关于ParseException的问题。

Posted by:lopwind

Posted on:2007-07-25 21:24

大家好,我是新手,想请教高手一下一个关于ParseException的问题。调试的时候出错,提示我ParseException cannot resolve symbol. 程序段如下:

private static void parse(AbstractQuery _query) {

while(!currentToken.equals(END)) {

if(currentToken.equals("query:")) {

nextToken();

parseQueryClause( _query);

continue;

}

if(currentToken.equals("category:")) {

nextToken();

parseCategoryClause(_query);

continue;

}

if(currentToken.equals("fetch:")) {

nextToken();

parseFetchClause(_query);

continue;

}

throw new ParseException ("Unknown descriptor:" + currentToken);

}

}

错误提示是:

symbol : constructor ParseException (java.lang.String)

location: class java.text.ParseException

throw new ParseException ("Unknown descriptor:" + currentToken);

我查了ParseException的定义方法,是ParseException(String , Offset);但是我在+ currentToken后边加 ,0 把Offset加上之后,系统又提示我说前边的

nextToken();

unreported exception java.text.ParseException; must be caught or declared to be thrown

请高手帮忙~~万分感谢

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值