toString()方法 一般出现在System.out.println(类名.toString());
toString()是一种自我描述方法 本身返回的是 getClass().getName() + “@” +Integer.toHexString(hashCode());
也就是 类名 + @ +hashCode的值
重写toString() 只会对类生效,并不能字符串生效; 例如
public class pratise {
2 String num="aaaa";
3 public String toString(){
4