Answer the question
In order to leave comments, you need to log in
Why is the getSortedList() method called without a reference to the original list?
Good time knock.
There is an example of sorting a list.
Within the application, the resulting list is specified as follows: ArrayList<Data> sortedList = getSortedList();
The getSortedList() method itself operates on a copy of the original list, eventually returning a sortedCopy.
However, the question arises: why is this method called without a reference to the original list, but a record like this:
ArrayList<Data> sortedList = originalList.getSortedList();
Answer the question
In order to leave comments, you need to log in
Well, probably the method is static and in the class there is only one field describing the list.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question