我见过如下一段代码:
public Object parse() throws XMLException
{
builder.startBuilding(reader.getSystemID(), reader.getLineNr());
scanData();
return builder.getResult();
XMLException e;
e;
throw e;
e;
throw new XMLException(e);
}
其中:
XMLException e;
e;
throw e;
e;
throw new XMLException(e);
这样的写法正确吗?我好象还是第一次见到.
public Object parse() throws XMLException
{
builder.startBuilding(reader.getSystemID(), reader.getLineNr());
scanData();
return builder.getResult();
XMLException e;
e;
throw e;
e;
throw new XMLException(e);
}
其中:
XMLException e;
e;
throw e;
e;
throw new XMLException(e);
这样的写法正确吗?我好象还是第一次见到.
throw e就是抛出异常,throw new XMLException(e)这个也时类似的抛出异常以上都没问题,至于e;这个似乎就有问题了
楼主把e理解为变量名就好了
e;
throw e;
e;
throw new XMLException(e);