• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Local class

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javaCertificate Q.
-------------------
Which of the following statements are true? [Check all correct answers]
1. Local classes can access final variables and final parameters of the enclosing method and non-final member variables of the outer class.
2. A constructor cannot be defined for a anonymous class.
3. An instance of a static nested class can be created without an instance of its enclosing class.
4. None of the above.
Answers: 1,2,3.
I did not choose 1, because I thought the statement suggests that local classes can ONLY access non-final member variables of the outer class.
Does anyone else have that problem?
Thanks.
[ November 06, 2003: Message edited by: Cathy Song ]
 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cathy
In my opinion, I don't think there's any problem with the question.
Option 1 doesn't say ONLY, so I would say it's an unfair assumption.
If I say "I have a cat", you can't assume that cat is the ONLY pet I have
Cheers
Harwinder
 
Cathy Song
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
 
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic