问题如下图所示,是否有任何选项可以启用显示成员abc
?
我正在使用IntelliJ IDEA CE 2017.2.1和JDK 9 + 179。
以上是示例代码:
public class Test {
@FunctionalInterface
interface IF {
String abc = "abc";
void apply();
}
public static void main(String[] args) {
IF theIF = ()->{};
System.out.println(theIF.abc); // I can print `abc` value here, but...
theIF. // DOT here(press ctrl + space) not show member `abc`
}
}
答案 0 :(得分:3)
这是使用实例限定符访问静态成员,最好以IF.abc
完成。因此代码完成并不能立即提供,但如果你第二次按下Ctrl + Space,则应该建议。