静态导入
package net.wjn.day1; import static java.lang.Math.*; public class StaticImport { public static void main(String[] args) { int x=1; x++; System.out.println(x); System.out.println( max(3,6));//求最大 System.out.println( abs(9-6));//两数相减 } }
package net.wjn.day1; import static java.lang.Math.*; public class StaticImport { public static void main(String[] args) { int x=1; x++; System.out.println(x); Math.max(10, 5); System.out.println( max(3,6));//求最大 System.out.println( abs(9-6));//两数相减 } }