JDK 1.5 or higher is required!
package
test;

public
interface
I
{
String CONST_VALUE = "const value"; // default public static final
}
package
test;

import
static
test.I.
*
;

public
class
Demo
{
public static void main(String args[]){
System.out.println(CONST_VALUE);
}

}
输出const value
上面的代码与下面的效果一样
package
test;

//
import static test.I.*;
public
class
Demo
{
public static void main(String args[]){
//System.out.println(CONST_VALUE);
System.out.println(I.CONST_VALUE);
}

}
输出const value


















输出const value
上面的代码与下面的效果一样













输出const value