回复

丶_丶

2018年10月11日

public class TestFred { public static void main(String[] args) { Object o=new Object(){ public boolean equals(Object obj){ return true; } }; System.out.println(o.equals("Fred")); } } 

看错题了,equals方法师写在Object类里面的。这个知识点是函数的重写。。

跟String类无关的。。。楼上。。  

0 0
回复
暂无回复
查看更多
我要回复