r/javahelp • • Sep 12 '19

What is the difference between "[ClassName].this.variable" and simply, "this.variable"

So I came across this class called:

AutoCompleteComboBoxListener()

with a node called comboBox.

And inside its methods, such as

selectClosestResultBasedOnTextFieldValue(),

they refer to the comboBox of AutoCompleteComboBoxListener() as

AutoCompleteComboBoxListener.this.comboBox.getItems();

Is it different from:

this.comboBox.getItems();

Thanks a lot everyone.

17 Upvotes

9 comments sorted by

View all comments

0

u/[deleted] Sep 12 '19

[deleted]

0

u/ZukoBestGirl Sep 12 '19

Not really. A non static inner class will always have access to it's parent. [ParentName].this.field.