摘要:
每一个非基本类型的对象都有一个toString 的方法,当编译器需要一个String类型而你只有一个对象的时候这个方法便会被调用如package text;public class text1 { public static void main(String args[]){text12 tex=new text12(); System.out.println(tex); }} class text12{private String i="b"; text1 a=new text1(); public String toString(){ return "+i=& 阅读全文
posted @ 2012-03-03 14:36
心中的她
阅读(161)
评论(0)
推荐(0)
浙公网安备 33010602011771号