我的代码看起来像这样:
public class A<T extends A> {
private T one() { return (T) this;}
protected T two() { return (T) this;}
protected void three() { two().one(); }
}
Run Code Online (Sandbox Code Playgroud)
IntelliJ告诉我"one()在A中有私人访问权限",但是,嘿,为什么我不能调用同一个类的私有成员?
我的代码看起来像这样:
boolean[] array = new boolean[200];
int[] indexes = {10, 42, 62, 74};
while(true) {
//some code here
StringBuilder sb = new StringBuilder();
for (int j : indexes) {
sb.append(array[j] ? '1' : '0');
}
}
Run Code Online (Sandbox Code Playgroud)
字典代码:
ASTORE 3 //"indexes" array
...
ALOAD 3
ASTORE 8
ALOAD 8
ARRAYLENGTH
...
Run Code Online (Sandbox Code Playgroud)
我不确定为什么javac复制引用数组到另一个本地var.