Beyond fixed-size arrays — dynamic arrays and increasingly complex nested combinations of objects and arrays. Note: dynamic arrays are not examinable in the practical exam.
| Comparison | Static array | Dynamic array |
|---|---|---|
| Size | Fixed at creation, cannot change | Can grow/shrink as needed at runtime |
| Flexibility | Must know the required size in advance | No need to know the size in advance |
| Typical use | When the number of elements is known/fixed | When the number of elements varies or is unknown |
Combining different data structure designs — these get progressively more complex and are common in a well-designed final PAT:
Example
public class Learner { private String name; private int[] subjectMarks; // array as a field private Address homeAddress; // another object as a field }
💡 Exam Tip
For the theory paper, focus on describing WHY you'd choose a given nested structure for a described scenario, rather than needing to code the most complex combinations from scratch — that level of implementation belongs to the PAT.