Q: Can a Class (Inner or Outer) be declared static ?

– Short answer  –


 – for the impatient but wana know more kind –

    only Nested-Top level class can be declared static.

     There are 2 types of class Top-level (Opter) and Inner (Anonymous, Local,Member,Nested top-level)

     Local – Class declared in a code block or method and is visible inside tha block only like a local variable

     Member – is visible for the entire class, you can instantiate this class only with in the context of the object, and hence cannot have its own indivudial existance, and cannot be instantited without an object of the outer class

     Nested top level class – is like a member class with static modifier. It is just like anyother top-level class but declaed inside another class,

long answer starts here 🙂


Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s