For an instance of an inner class, this refers to that inner class instance, not the instance of the outer class that created it. So, here, we get class Bar when we try printing the class name for an instance of Bar using this.

You can learn more about this in:
Run Edit