The method getCarpetsWith(minimalRequiredArea) returns memory address (and method Arrays.ToString doesnt help too) however I need to get the array list as text. Btw the method printInfo needs to stay void - pretty new to java so hopefully someone helps, thank u!
public static void main(String[] args) {
CarpetShop CarpetShop = new CarpetShop();
CarpetShop.createNewCarpetInShop("white", 5, 5);
CarpetShop.createNewCarpetInShop("blue", 12, 5);
CarpetShop.createNewCarpetInShop("", 5, 5);
System.out.println((CarpetShop.getCarpetsWith(10)));
}}```
The method
```public Carpet[] getCarpetsWith(int minimalRequiredArea) {
int carpetsWithAreaIndex = 0;
Carpet[] carpetsWithArea = new Carpet[getCarpetsCount(minimalRequiredArea)];
for (int i = 0; i < carpets.length; i++) {
if (carpets[i] != null && carpets[i].getArea() >= minimalRequiredArea) {
carpetsWithArea[carpetsWithAreaIndex++] = carpets[i];
}
}
return carpetsWithArea;
}
}```
printInfo method
``` public void printInfo() {
System.out.println(color + " " + sizeWidth + " " + sizeHeight);
}```