This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Nested & Deeply Nested instance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Nested & Deeply Nested instance" Watch "Nested & Deeply Nested instance" New topic
Author

Nested & Deeply Nested instance

Alex Grig
Ranch Hand

Joined: Oct 19, 2001
Posts: 38
Hello friends,
Could anyone give the details about the following code:

thanks.
------------------
Alex J.Grig


Alex J.Grig
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Oct 19, 2001
Posts: 38
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

Joined: Sep 16, 2001
Posts: 139

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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Nested & Deeply Nested instance
 
Similar Threads
Overriding function problem
A Nested Class Question
Inner class and this ?
Hierarch of non-static inner class
Inner classes within inner classes