1
Import java.util.*; Public classaslist{ Public Static voidMain (String args[]) {//int arr[] = {1,2,3,4,45}; //list<int[]> List = arrays.aslist (arr); //List.add ("QQ"); Cannot be added here, because the length of the array is fixed//integer[] nums = {2,4,5,2}; //list<integer> li = arrays.aslist (nums); //if the element in the array is an object, then the elements in the array go directly to the elements in the collection when they become collections//if the element in the array is the base data type, the array will be present as an element in the collection.String arr[]= {"ABC","cc","KKK"}; List<String> list =arrays.aslist (arr); List.contains ("cc"); } Public Staticboolean mycontains (string[] arr,string key) { for(intx=0; x<arr.length;x++) { if(Arr[x].equals (key))return true; } return false; }}
Java Collection Framework tool class collections, operation of the collection