File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MindQ question #47

 
Nain Hwu
Ranch Hand
Posts: 139
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
47. In the list below, which subclass(es) of Component cannot be directly instantiated:
a) Panel
b) Dialog
c) Container
d) Frame
The answer is c.
I thougt b should be the answer, since Dialog would need a
Frame to help instantiate it.
I am confused. :confused So I wrote a code to test it as below.
It compiled without error and ran.


Any thought?
 
Jane Griscti
Ranch Hand
Posts: 3141
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nain,
Think you're right. All the Dialog constructors take an 'owner' as an argument.
The question is a little misleading, as you can instantiate a Dialog if you pass in an 'owner'. Perhaps they mean which one can't stand on it's own?
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Nain Hwu
Ranch Hand
Posts: 139
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Jane. It clears my doubt.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic