i having an error red underline .add while trying to add items into vector.
any solution please? thanks!!
import java.util.Vector;
import java.util.*;
public class AllProduct {
private Vector<Product> allproducts = new Vector<Product>();
private Vector<Product> mProduct;
public AllProduct () {
allproducts.add("bb");
}
...
}
"bb"is aString, not aProduct. You’ll need to make aProductsomehow, e.g.new Product("bb").