aspose file tools*
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 Spring in Action this week in the Spring 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.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Nested & Deeply Nested instance