class Cups...{
private String s = new String (“hello”);// 在定义对象的时候
private String t;
private String s1;
Cups()...{
t = new String(“constructed”);//构造函数里定义
}
public String toString()...{
if (s1 == null)...{
s1 = new String (“welcome”);//用到的时候
}
return s1;
}
}