1)In here I want to know to get the output as "Body" why we have to apply Body.this.name?please explain this.
we want to refer to the outer class isn't it?
now when we are accessing inner class, then the
this reference refers the inner class object
so to access the outer class object we have to write
OuterClass.this
2)what code we have to type in getPName () method to get Heart as a output.
Now we want to the member of inner class isn't it?
hence we simply use the
this reference
the code is as follows
Hope this helps
hth
happy preparation
[edit] corrected the mistake
in the code as per Deepak's suggestion [/edit]
@ Deepak
is this good way to correct the mistakes and editing the posts
I mean writing the edit tag (I have seen this from many good people)
am I contributing neatly?