This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
If I have a constructor: public Persons(Person[] aList, int aSize) & a field: private Person[] personList;
how can I 1. Form a Person array of length aSize and put the address of this array into personList. 2. Then use the constructor to copy the first aSize persons from aList onto the newly created array.
You can create an array using the new operator, just like classes:This creates an array of twelve ints, each initialized to the default value zero. You can use System.arraycopy() to copy a range of values from one array to another.