aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Jane Griscti's tutorial 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 "Jane Griscti Watch "Jane Griscti New topic
Author

Jane Griscti's tutorial

Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
This question is mainly addressed to Jane Griscti but anyone who has any idea about the answer is free (and encouraged) to give it
In the tutorial "SCJP2 Study Notes", in section "Overloading, Overriding, Runtime Types and Object Orientation - Static Nested Classes" it is stated, I quote:

- they are not associated with an instance of their outer class ie you can create an Inner class object from within the Outer class using new Inner(); you do not need to create an Outer class object first as is required with non-static inner classes
- you cannot create instances of a static inner class

So to summarize, the first statement says that we may create an Inner class object and the second statement says that we cannot create instances of static inner classes. It is worth noting that both statements concern static inner classes, a.k.a. top-level nested classes.
Anyone any insight ?
Thank you very much
Val


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Anyone,
I would be really grateful if you could answer the question.
Thank you very very much
Val
Jane Griscti
Ranch Hand

Joined: Aug 30, 2000
Posts: 3141

Anyone any insight ?

Yup ... I'm not the greatest note taker The pages aren't meant to be a 'tutorial' ... just the notes I made during my orignal studies.
You can create 'instances' of a static nested class. See the following example:

Thanks for pointing out the mistake on my pages.
Also, I should have listed that 'static inner classes can directly access static fields in the outer class but require an instance of the outer class to access the outer class instance fields'


------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform


Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Thank you Jane
it helped a lot...
Val
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Where I can find these study notes?


SCJP2. Please Indent your code using UBB Code
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Here - http://www.janeg.ca/
HTH,
- Manish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jane Griscti's tutorial
 
Similar Threads
Inner Class Question....
Inner Classes
use of static nested class?
Outside code as an Inner class
inner class & nested class?