ArrayList<Items> itemsClass = new ArrayList<Items>();
itemClass.add(new Items(String, int, boolean));
public class Items{
String x;
int y;
boolean z;
public Items(String x, int y, boolean z){
x = this.x;
y = this.y;
z = this.z;
}
public toString(){
/*
*This is my question
*/
}
}
如何在此类中使用构造函数编写 toString 方法,以便可以添加到我的 ArrayList?