• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Sarga Qns

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I took the Sarga test simulator mock exam yesterday. The simulator is not too good. It has radio buttons in some places, where there should be check boxes. There are a few questions, the answers of which I'm not sure about:

1. Which cannot be added to a Container?
A.an Applet
B.a Component
C.a Container
D.a Menu
E.a Panel
My answer: A. Answer given: D

2. What tags are mandatory when creating HTML to display an applet. Select most appropriate answer.

a) name, height, width
b) code, name
c) codebase, height, width
d) code, height, width
e) None of the above
My answer: d. Answer given: c

I know that the second answer has been discussed somewhere, but I couldn't find it !!. Could somebody help me with both of these qns?
Thanks in advance,
Aman
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.For first Question the 'Given Answer is correct'. Menu can not be added to container and so menu can only be added to menu bar.
2. For second question your answer is correct. The mandatory tags are 'Code,width and height'.
To get more info,you can refer 'Cram book' or JLS.
You can give your jusfication for your answers. So it will be helpful for us to answer.
Hope this helps.
Nirmala
 
Amandeep Waraich
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Nirmala,
Do you mean that we CAN add an applet to a Container? How can we do this? I thought that answer A (applet) is right and D (menu) is not right, because according to Exam Cram Ch.11 p.220:

Adding menus to an application requires a class that implements the MenuContainer interface. The classes in the java.awt package that implement MenuContainer are Component, Frame, Menu, and MenuBar, so practically anything on the screen can host a menu.

Now, Container is a subclass of Component. So, shouldn't Container be capable of hosting a menu?
Thanks,
Aman
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure what the correct answer is, but here's my two cents:
A: Applet is subclass of Panel, and a Panel cannot stand by itself, it has to be added to other Containers (corret me if I am wrong), in the case of an Applet, it's the browser window, or maybe appletviewer.
D: If Menu means normal pull-down menu then it can only be added to a MenuBar. However, a PopupMenu can be added to any Components.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic