How to sort an Array ArrayList?



import java.util.Collections;  // Import the Collections class

ArrayList <Float> list = new ArrayList();

list. add (17.1); 
list. add (7.7);
list. add (12.9);

println(list); 

Collections.sort(list); 

println(list); 

1 Like