Only as Learning notes
/* Set the framework of the tool class
collections:
* *
import java.util.*;
Class Test
{public
static void Main (String [] args)
{
list<string> ls = new arraylist<string& gt; ();
Ls.add ("AAA");
Ls.add ("AFS");
Ls.add ("FDS");
Ls.add ("BCD");
SOP (LS);
Collections.sort (LS);
SOP (LS);
String tmp = Collections.max (LS);
SOP ("Max:" +tmp);
int index = Collections.binarysearch (ls, "BCD");
SOP ("Index:" + index);
int index2 = Collections.binarysearch (ls, "bcde");
SOP ("Index2:" + index2);
Returns the index of the search key if the search key is included in the list, otherwise return (-(insertion point)-1)
//replace
collections.replaceall (LS, AFS, KK);
SOP (LS);
Inversion, inverse
collections.reverse (LS);
SOP (LS);
The Fill method converts all elements in the list collection to the specified element
collections.fill (ls, "pp");
SOP (LS);
public static void Sop (Object obj)
{
System.out.println (obj);
}
}