I want to add the add different arrayLists of type Product to orderProcessor. These different arrayLists have objects of type Products and its subclass. Is this code good or are there errors?
for(int i = 0; i < genericOrder.size(); i++) {
orderProcessor.add(genericOrder.get(I));
System.out.println(orderProcessor.get(i));
}
Also, later I categorically add these to different arrayLists of different Types. However these types are still subTypes of Product such as ComputerPart object. I am doing this to have different types in different Lists. I don't think it's working since I am not getting any output. What is causing my error?
for (int i = 1; i < orderProcessor.size(); i++){
computerPart.add((ComputerPart) orderProcessor.get(I));
}
orderProcessor.addAll(genericOrder)?