//定义类,由静态方法组成
package org.demo1.a;
public class Operate{
public static int add(int i,int j){
return i+j;
}
public static int sub(int i,int j){
return i-j;
}
public static int mul(int i,int j){
return i*j;
}
public static int div(int i, int j){
return i/j;
}
}
//使用静态导入
package org.demo.b;
import static org.demo.a.Operate.*;
public class StaticImportDemo{
public static void main(String args[]){
System.out.println(add(2,3));
System.out.println(sub(3,2));
System.out.println(mul(3,4));
System.out.println(div(6,2));
}
}