• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Nested top level class  RSS feed

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is from Marcus mock exam3.
Is the following statement
1) true or
2) false?
"a nested top-level class cannot declare any static variables, static methods, or static
initializers."
ANSWER IS TRUE.
Nested top level class means static inner class right??static inner classes can have static stuff right???
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sree,
You are right. This discussion had already come up in Marcus's Discussion board and he accepts the qstn is in error. Since his page has got frames I can't direct you to the exact page. So I post the answer from Marcus here.
I am moving this to Errata Forum. Thanks.
regds
maha anna

I have a feeling you are right and the question is wrong. However I put notes on all my answers and you will see that I make a reference to the O'reilly version of the Java Language Reference (page 123 to be exact) where it makes this rather odd claim.
Noticing how wierd this was I have looked up the errata at oreilly.com and this is not mentioned.
Strange. But to get back to your question I think my question is in error.
Marcus

 
sreelakshmi sarma
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maha.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!