how we suppose to know what is m4a[x].counter? At the loop one, x = 0, so m4a[x].counter = m4a [0].counter, am I correct? Yet, it does not mean any specific figure, or is there anything I have missed out?
If you're asking how to look at the value of m4a[0].counter, then I would say correct the System.out.println statement to look like this:
If you want to know how the program arrived at number, I would write out what the program is doing, line by line. I'll start:
* set count to 0
* initialize m4a to 20 elements
* set x to 0
--- first iteration
* instantiate m4a[0] to new Mix4(), counter is 0
* add one to m4a[0].counter, counter is 1
* add one to count, count is 1
* add m4a[0].maybeNew(0) to count
** index is 0
** instantiate m4 to new Mix4(), m4.counter is 0
** add one to m4.counter, 1
** return 1
* count is 2
* add one to x, x is 1
--- second iteration
* instantiate m4a[1] to new Mix4(), counter is 0
* add one to m4a[1].counter, counter is 1
* add one to count, count is 3
...
You can continue like this as far as you like, then check your assumptions with System.out.println() statements in the code.
HTH