This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

answer please

 
josephine chen
Ranch Hand
Posts: 216
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Roll
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • 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)
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • 0
  • Mark post as helpful
  • send pies
  • 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>
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator

Tony, can you please tell me what are top-level inner classes and top-level classes
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • send pies
  • Quote
  • Report post to moderator
are nested toplevel classes and static inner classes the same??
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • send pies
  • Quote
  • Report post to moderator
thanks,jim
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic