class Demo
{
}
class Test
{
public static void main(String[] args)
{
Demo d=new Demo();
System.out.println(d);
System.out.println(d.toString());
String s=new String("abc");
System.out.println(s);
System.out.println(s.toString());
}
}
终于清楚了,以前学C语言打印地址就直接输出地址,而java却是打印的是 对象的应用.toString() |