:confused:
Hi,
I have this homework to do and I have to solve a method called:
public Collection toCollection(). Here is what i solved so far:
final class InventorySet {
private Map _data;
int thesize;
InventorySet() {
// TODO
_data = new HashMap();
}
/**
* Return the number of Records.
*/
public int size() {
// TODO
thesize = _data.size();
return thesize;
}
/**
* Return a copy of the records as a collection.
* Neither the underlying collection, nor the actual records are returned.
*/
public Collection toCollection() {
// Recall that an ArrayList is a Collection.
// TODO
}
Thank you very much for your help
Dounia