Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

answer please

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
13)
Which of the following statements is true?
a) An interface can contain a nested top-level inner class.
b) An interface can contain a member inner class.
c) A member inner class can implement an interface.
d) A static method can contain a local class.
e) A static method can contain a nested top-level class.
is it c) and d) only.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right shan, its c) and d).
a) is incorrect because interface contains nested top level class.
b)is incorrect.Because,Look a).
c)correct
d)correct
e)is incorrcect because of d)
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<PRE>
Which of the following statements is true?
 
a) An interface can contain a nested top-level inner class.
YES
 
b) An interface can contain a member inner class.
NOPE. Even without the static keyword it will be assumed to be static.
 
c) A member inner class can implement an interface.
TRUE
 
d) A static method can contain a local class.
TRUE. That type of class can be in any type of method.
 
e) A static method can contain a nested top-level class.
NO!! Methods can only have LOCAL classes.
 
is it c) and d) only.
</PRE>
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tony, can you please tell me what are top-level inner classes and top-level classes
 
Tony Alicea
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nested classes are classes defined inside other classes. This was new with Java 1.1. What book are you using to prepare? This subject is kind of 'heavy' and it's better to read something about it first. The SUN specification is in:
http://java.sun.com/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc.html
Let us know...
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are nested toplevel classes and static inner classes the same??
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. Different authors use the both terms, and Sun is not really consistent either. It's a mess.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks,jim
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic