Question: So, I'm trying to create a sketch pad and I'm at the stage where I created the squares, I linked to functions of colouring the squares with DOM and linked a function that creates as many squares as user wants but when I resize the page(mobile, less than normal full screen), the DIV or full square just spreads vertically instead of keeping the same aspect.

<https://jsfiddle.net/cpv8Lqj0/>

```css
.container {
  position: fixed;
  font-size: 0;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  padding: 0;
  width: auto;
  height: auto;
}

```

I tried with auto height and width, no answer.

Answer: 
Please consider the following points:

1. `MyClass` does not need to extend `ArrayList`.
2. Use Generics to instantiate the concrete classes e.g. `List<MyClass> numberSeries = new ArrayList<MyClass>();`
3. Override the `toString()` method in `MyClass` so that it becomes easier for you to print it.

Given below is the complete program incorporating the above points:

```
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MyClass{

    public int[] numAsc = {};
    public int[] numDsc = {};

    public MyClass(int[] numAsc, int[] numDsc) {
        this.numAsc = numAsc;
        this.numDsc = numDsc;
    }
    public String toString() {
        return "numAsc: "+Arrays.toString(numAsc)+", numDsc: "+Arrays.toString(numDsc);
    }
}

public class TestMyClass{
    public static void main(String[] args) {
        List<MyClass> numberSeries = new ArrayList<MyClass>();
        int[] orders  = {1,2,3};
        int[] request = {3,2,1};    

        numberSeries.add(new MyClass(orders,request));

        System.out.println(numberSeries);
    }
}

```

**Output:**

```
[numAsc: [1, 2, 3], numDsc: [3, 2, 1]]

```
I don't see why you extend `ArrayList`. I think you are overthinking it, if you just want to build a list of `MyClass` it does not need to extend `ArrayList`

* Remove the extend,
* make a sensible `toString` method on your `MyClass` object so you can see the values in your arrays

```
class MyClass {

    public int[] numAsc;
    public int[] numDsc;

    public MyClass(int[] numAsc , int[] numDsc){
        this.numAsc = numAsc ;
        this.numDsc = numDsc;
    }

    @Override
    public String toString() {
        return "numAsc: " + Arrays.toString(numAsc) + " | " +
                "numDsc: " +  Arrays.toString(numDsc);
    }
}

```

Then run your main, it outputs:

> 
> numberSeries = [numAsc: [1, 2, 3] | numDsc: [3, 2, 1]] 
> 
> 
>