I have a school assignment on immutable generic Binary Search Trees in java. I have implemented all of the basic BST functions but we are also asked to create a saveInOrder function that takes a generic array of type Entry that should be modified in the function to contain all of the Entries in order of the value of their key.
We are given an interface to implement, and in that interface there is a method signature
public void saveInOrder(Entry<Key,Value> a[]);
I'm confused as to why the [] brackets are after the 'a'? Shouldn't it be
Entry<Key,Value>[] a?
Also, will the array passed to this function have a size defined already? I googled generic arrays and have realised they're a tricky topic. Any explanations would be great thanks! Sorry if it's a little ambiguous