I know about inner class and nested class from Java inner class and static nested class
But can any body tell me what's the difference between Inner.redo1() and Inner.redo2()?
Or Inner.print1() and Inner.print2() are the same?
public class Outer {
private String str = "outer";
public void print() {
System.out.println("a");
}
public class Inner {
public void redo1() {
print();
}
public void redo2() {
Outer.this.print();
}
}
}
PS: In java.util.ArrayList.Itr#remove
public void remove() {
if (lastRet < 0)
throw new IllegalStateException();
checkForComodification();
try {
ArrayList.this.remove(lastRet);
cursor = lastRet;
lastRet = -1;
expectedModCount = modCount;
} catch (IndexOutOfBoundsException ex) {
throw new ConcurrentModificationException();
}
}
Why does it use ArrayList.this.remove(lastRet);
but not remove(lastRet);
?