This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Nested & Deeply Nested instance

 
Alex Grig
Ranch Hand
Posts: 38
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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