本帖最后由 尘埃落定 于 2014-7-24 10:11 编辑
如下代码错误提示,什么问题?如何解决?
- /*重写object类中的equals方法示例。
- * */
- public class EqualsTest {
- Demo_2 d1 = new Demo_2(5);
- Demo_2 d2 = new Demo_2(6);
-
- boolean b = d1.equals(d2);
- System.out.println(b);
- /*错误提示:Multiple markers at this line
- - Syntax error on token "b", VariableDeclaratorId expected after this
- token*/
-
- Person_2 p = new Person_2();
- boolean b1 = d1.equals(p);//
- System.out.println(b1);
- /*错误提示:Multiple markers at this line
- - Syntax error on token(s), misplaced construct(s)
- - Syntax error on token "b1", VariableDeclaratorId expected after this
- token
复制代码
|
|