Java错误大全

来自CloudWiki
跳转至: 导航搜索

语法错误

  • Syntax error, insert "}" to complete ClassBody
缺少大括号,需插入大括号} 完成类的编写。
  • Syntax error on token "}", delete this token
大括号多余,删除这个大括号

变量和类定义错误

  • Scanner cannot be resolved to a type
没有引入相关的类


  • Duplicate local variable i
 变量定义重复

方法定义错误

  • Duplicate method main(String[]) in type Main
在类里有两个主方法(main)
  • The constructor ** is undefined
构造方法没有定义
  • The method ** is undefined
该方法没有定义

面向对象错误

The type Salary must implement the inherited abstract method Income.getTax()

接口的实现类必须实现接口的全部功能