JDK 1.4编译错误

时间:2014-02-26 16:31:12

标签: java

我的代码在JDK 1.6中完全没问题,但是当我在JDK 1.4中编译它时,我得到了错误

代码是

  public void generateSection(long parId, long splId, long ogrId) throws    DBUexecuteQueryException, DBUqueryParameterException, DBUcreateQueryInstanceException
  {
    DBUquery dbu = new DBUquery(mcl_ts, mainGenerator.con);
    dbu.createPreparedStatement(stmt);
    dbu.setPreparedParameter(1, parId);
    dbu.setPreparedParameter(2, splId);
    dbu.setPreparedParameter(3, ogrId);

    dbu.createListFromResultSet(new DBUrowToObject()
    {
      //@Override
      public Object rowToObject(ResultSet rs) throws SQLException
      {
        String name = rs.getString("name");
        writeLn("<Outlet name=" + q(name) + "/>");
        return null;
      }
    });

,错误是  'class'或'interface'预期在});

有什么想法吗? :)

1 个答案:

答案 0 :(得分:0)

检查花括号对。在类的右大括号后面有某些东西(可能是另一个})时会发生此错误。像这样:

public class SomeClass {       
    private Object someMethod(){
    }
}
} <== This