I am trying to generate random food and detergent objects and add them to a products arraylist,(food and detergent classes extend products),but when I try to read from the arraylist all the random properties I inserted are 0 or null. I can provide you with the code for the other classes if needed but I don't think that there is a problem with the constructors. Thanks beforehand.

```
    ArrayList<Products> products = new ArrayList<>();
    for (int i = 0; i <= 300; i++) {
        char[] chars = "abcdefghijklmnopqrstuvwxyz".toCharArray();
        StringBuilder sb = new StringBuilder();
        Random random = new Random();
        for (int a = 0; a < 10; a++) {
            char c = chars[random.nextInt(chars.length)];
            sb.append(c);
        }
        String a = sb.toString();

        Random generator = new Random();
        int randomIndex = generator.nextInt(manufacturers.length);
        String b = manufacturers[randomIndex];

        int randomIndex2 = generator.nextInt(suppliers.length);
        String c = suppliers[randomIndex2];

        Random r = new Random();
        int d = ThreadLocalRandom.current().nextInt(7, 28 + 1);
        int e = ThreadLocalRandom.current().nextInt(12, 31 + 1);
        int f = ThreadLocalRandom.current().nextInt(-1, 30 + 1);
        int g = ThreadLocalRandom.current().nextInt(-8, 25 + 1);

        products.add(new Food(a, b, c, d, e, f, g));

```

here is the food constructor:

`Food(String name,String manufacturer,String supplier,int purchase_price,int selling_price,int sale_date,int expiration_date){
 super(name,manufacturer,supplier,purchase_price,selling_price,sale_date);
 expiration_date=this.expiration_date;
}`

and the products superclass code:

```
    Products(String name,String manufacturer,String supplier,int purchase_price,int selling_price,int sale_date){ 
    name=this.name;
    manufacturer=this.manufacturer;
    supplier=this.supplier;
    purchase_price=this.purchase_price;
    selling_price=this.selling_price;
    sale_date=this.sale_date;}`

```