• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Nested top level class

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Maha.
 
It means our mission is in jeapordy! Quick, read this tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic