【发布时间】:2013-04-01 07:32:27
【问题描述】:
在我的程序中,我复制并粘贴了代码(显然是禁止的),因为我还没有弄清楚如何将我想要的参数传递给这个方法:
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;
}
我该怎么做?
【问题讨论】:
标签: java class object methods arraylist