定义一个接口,然后实现就是了. 但你的具体意思是?package x;
interface MyConst {
  public static final float pi = 3.1415;
}//
package y;
import x.MyConst;
public class ZZZZ implments MyConst {
  ...
}