I normally use C# and am not very familiar with Java API, but here is what I want to do:
I have two arrays:
String[] names = concertNames.toArray(new String[concertNames.size()]);
Double[] rates = concertRates.toArray(new Double[concertRates.size()]);
Each element from names
corresponds to elements from rates
, i.e. names[i]
has a rate of rates[i]
.
I would like to get the names of N top-rated concerts. In C# I would use LINQ, and here, I'm not sure.
Edit: Off-topic? Are you people serious? I know how to sort an array, I just don't want to write 50 lines of horrible, rudimentary code in order to do a trivial thing.