日期:2014-05-20 浏览次数:20900 次
import java.util.*; import java.io.*; class Password implements java.io.Serializable{ String name; String password; public Password(){name = ""; password = "";} public Password(String n, String p){ name = n; password = p; } public boolean equals(Object p){ Password pw = (Password)p; return name.equals(pw.name) && password.equals(pw.password); } public String toString(){ String s = name +" "+password; return s; } }
------解决方案--------------------
楼上的代码有人测试了吗?
------解决方案--------------------
参考:
http://school.itzcn.com/special-spid-50.html
上面讲解的比较详细,希望对楼主有所帮助。