java - How is "this" used when it comes after a Class like this? -


i don't quite understand how keyword this being used in instance.

private void checkforcomodification() {     // i'm concerned first 1     if (cyclicarraylist.this.modcount != this.modcount)         throw new concurrentmodificationexception(); } 

you need in inner classes.

this points inner class instance itself.

myouterclass.this points containing class instance.

in case, necessary, because both classes have modcount property (and 1 outer class cyclicarraylist shadowed here).


Comments

Popular posts from this blog

java - Unable to make sub reports with Jasper -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -

Passing Variables from AngelScript to C++ -