Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested & Deeply Nested instance

 
Alex Grig
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
Could anyone give the details about the following code:

thanks.
------------------
Alex J.Grig
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the modified code...

Hope this helps
Shyam
[This message has been edited by Shyamsundar Gururaj (edited October 25, 2001).]
 
Alex Grig
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Shyam.
But I still have two Q.
Q1:
When i asked "why B.C?" i did mean why not A.B.C?
Because B.C and A.B.C both work perfectly!
Q2:
When put A.B.this.x = x outside f() what's the problem?

------------------
Alex J.Grig
 
Nain Hwu
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Q1:
When i asked "why B.C?" i did mean why not A.B.C?
Because B.C and A.B.C both work perfectly!

Because main() is within the scope of class A, so A.B.C is
eqivalent to B.C as far as type is concerned.

Q2:
When put A.B.this.x = x outside f() what's the problem?


Outside methods, you can only declare/initialize class members
and/or define constructors. What you are trying to do is
not any of them.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic