• 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

question Dan's Exam : local classes

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exam 3 question 9
Which of the follow are true statements.
a. A local class is declared within a method, constructor or block.
b. An anonymous class is always a local class.
c. A local class is a nested class.
d. A local class is a member class.
e. A local class is always a named class.
Answer is a c e
Problem I have here is that in the book K&B there is no mention of local classes but inner classes... So for me this question was confusing.
Now I want to now if on the exam they also use different terms...
Kristof
 
stable boy
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All local classes are inner classes and is a nested class.
A local class is not a member of any class.
A local class cannot have the access modifier: public, protected, private or static.
See for more informationhere
[ January 07, 2004: Message edited by: Thomas De Vos ]
[ January 07, 2004: Message edited by: Thomas De Vos ]
 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My mock exam focuses on the definition of terms far more than the
real exam, because the answers to the questions include detailed explanations that use those terms. The real exam does not contain any explanations for the answers, so the definition of terms is less important. The real exam will not contain questions that explicitly ask for the definition of terms such as member class or local class. However, if you do understand the terms, then it is an indication that you have a very good understanding of nested classes.
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kristof,
Are the following nested class declarations helpful?

[ January 07, 2004: Message edited by: Dan Chisholm ]
 
Kristof Camelbeke
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Dan thanks for your input...
I've looked at them and I still don't really get it...
are the following assumptions correct ?
1) class nestedClass1 {} = class memberClass1 {} = class innerClass1 {} =
class nestedClass10 {} = class innerClass10 {}:
they are all inner-classes, correct ?
2) static class nestedClass2 {} = static class memberClass2 {}
both are static nested classes, correct ?
The other 2 are anonymous inner classes...
 
reply
    Bookmark Topic Watch Topic
  • New Topic