在我的程序中,我复制并粘贴了代码(显然是不允许的),因为我还没有弄清楚如何将我想要的参数传递给这个方法:
public String collectionToFormattedString() {
String combined = "";
for (Book b : LibObj.books) {
combined = combined + b.toString() + "<br />";
}
combined = "<HTML>" + combined +"</HTML>";
return combined;
}
我想传递参数来执行以下操作:
public String collectionToFormattedString(Object? XYZ, ArrayList ABC) {
String combined = "";
for (XYZ b : ABC) {
combined = combined + b.toString() + "<br />";
}
combined = "<HTML>" + combined +"</HTML>";
return combined;
}
我该怎么做呢?