package chapter06;
import java.util.Arrays; import java.util.List;
public class Collection_util { public static void main(String[] args) throws Exception {
int[] is = {3,5,2,1,4}; int[] is1 = {1,2,3,4,5}; int[] is2 = {1,2,3,4,5,6}; System.out.println(Arrays.toString(is)); System.out.println(is);
List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5);
Arrays.sort(is); System.out.println(Arrays.toString(is));
System.out.println(Arrays.binarySearch(is, 5));
System.out.println(Arrays.equals(is2, is1)); System.out.println(Arrays.equals(is1, is)); System.out.println(Arrays.equals(is2, 0, 5, is1, 0, 5)); } }
|