On day 17, a set of relevant variable parameters

Variable Parameters: Episode 214.

 

Static import: StaticImport, 

When a class method of the same name, to specify a particular package name.

When the method of the same name, or an object comprising the specified class belongs.

 

import java.util.*;
import static java.util.Arrays.*;

import static java.lang.System.*;
public class Practice_1 {
    public static <K, V> void main(String[] args) {
        int[] arr = {3,1,5};
        sort(arr);
        int index = binarySearch(arr,1);
        out.println(Arrays.toString(arr));           // Object中也有 toString 方法
        System.out.println("Index="+index);
        
    }
}
 

 

Guess you like

Origin www.cnblogs.com/zxl1010/p/11466619.html