Chapter 17,18,22,23
J2EE - ROUND 21
CHAPTER 17
1. What does mean by GUI-
Answer:(Graphical user interface).
2.How manages the window pane-
Answer:By the JFrame.
3.What does mean by MVC-
Answer:(Model-View-Controller).
4.What does mean by AWT?
Answer:Abstract Windowing Toolkit.
5.What does mean by JFC?-
Answer:Java Foundation Classes.
6. Which Package contains the Swing Component?-
Answer: Javax.swing.
1|Page
Chapter 17,18,22,23
J2EE - ROUND 21
7. Which Components Depends on native code?-
Answer: Java.awt.
8. Which Components is pure java?-
Answer: Swing components.
9. Which three parts are of the MVC?-
Answer: Model, View, and Controller.
10. Container class is a base for the all classes? Yes/No-
Answer: Yes.
11. How many main () method for the window object?-
Answer: Three methods.
12. What is defined by the set Bounds () method?-
Answer: Size and position.
13. What is representing by the component?-
2|Page
Chapter 17,18,22,23
J2EE - ROUND 21
Answer: Graphical entity.
14. Which object manage window one?-
Answer : JFrame object.
15. what is the alternate name of window pane?
-Answer: content pane.
16. JApplet object have a menu bar? Yes/No
-Answer: Yes.
17. What is displayed by glass pane?
-Answer: Top of all the otter panes.
18. Where from derived Dialog box?
-Answer: From window class.
19. What is representing by the JFrame object?
– Answer : Represent the main window.
3|Page
Chapter 17,18,22,23
J2EE - ROUND 21
20. How many super class of Frame?
-Answer: Five Super classes.
21 . is visible() is Enable(), isValid() method return type is
Boolean
String
Integer
Nothing
22.If isValid () mentod return true then object is valid?
a.True b.False
23. which class contain in this mentod of getBounds(), getSize(),
getLocation()
a.component
b. container
c.Frame
24. what is the return type of this method getBounds();
a.dimension
b.rectangle
4|Page
Chapter 17,18,22,23
J2EE - ROUND 21
c.point
25. which is the valid declaration of a method?
a.point getsize();
b.Dimension getSize(int a);
c.Point getLocation ();
26.which package contain component class
a.Java.awt package
27. setBounds(int a, int b,350,450); setSize(Dimension d);
SetLocation(Point p) method return type is?
a.point
b.String
c.void
28.getToolkit mentod is a member of component class
a.true
b.false
29.The return type of getToolkit()method is
a.Dimension
b.Toolkit
c.String
30. is getToolkit () method an abstract class?
5|Page
Chapter 17,18,22,23
J2EE - ROUND 21
a.yes
b.no
31.getScreenSize() method is a member of--------class?
a.Toolkit
b.container
c.component
32.RGB stand for
a.red, green, blue
b. red, grow, blue
c.rat, green, black
33.The intensity of each primary color to be a value between
a. 1 to 255
b 0 to 250
c. 0 to 255;
34.Color col=new Color (255,255,255);
Which color we will get?
a.red
b. green
c.blue
d.black
e.white
6|Page
Chapter 17,18,22,23
J2EE - ROUND 21
35. when you will get green color?
a(0,255,0);
b.(0,0,0)
c.(10,0,0)
d.(0,255,255)
36. How can you create a text cursor?
a.Cursor cor=new cursor();
b.Cursor cor=new Cursor(Cursor.TEXT_CURSOR);
C.Cursor cor=new cursor(TEXT_CURSOR);
37. Return type of getDefaultToolkit() method
a.Toolkit
b.Dimension
c.Piont
38.getAllFonts()method return type id ?
a.Font[]fo;
b.Point
c.String
39. Which class is the base class of swing component ?
a.Jcomponent
b.component
c.JFrame
7|Page
Chapter 17,18,22,23
J2EE - ROUND 21
40.The main()method calls _________ for the a Window object.
a)two methods
b)three methods
c)four methods
d)five methods
41.There are three other argument values you could use with the
setDefaultCloseOperation() method that are defined in the
WindowConstants interface.These values ares:(Three correct
choice)
a)DISPOSE_OF_CLOSE
b)DISPOSE_ON_CLOSE
c)DO_NOTHING_ON_CLOSE
d)Do_ANYTHING_ON_CLOSE
e)HIDE_ON_CLOSE
42.The setBounds()and setVisible() methods are members of the
JFrame class ________ from the Component class.
a)graphicla
b)components
8|Page
Chapter 17,18,22,23
J2EE - ROUND 21
c)operation
d)inherited
43.you would typically use the key classes in this hierarchy:(how
key class).
a)three key class
b)four key class
c)five key class
d)six key class
44.you can alter some aspects of the appearance of the basic
component by calling methods for the object.
The following methods have an effect on the appearance of a
Component object:(two correct choice).
a)Color getBackground()
b)void setForeground(Color fBule)
c)void setFont (Font aFont)
d)Font getDouble()
9|Page
Chapter 17,18,22,23
J2EE - ROUND 21
45.The these to select or create a particular cursor.The standard
cursor types are:
a)DEFAULT_CURSOR
b)CROSSHAIR_CURSOR
c)WAIT_CURSOR
d)TEXT_CURSOR
e)HAND_CURSOR
f)ALL OF THE ABOVE
46.The Container class defines the following four overloaded
versions of the add()method:(two correct chice)
a)Componentance add(Comparator f)
b)Comparator add(Comparable w)
c)void add (Component c, Object constraints int index)
d)Component add(Component c,int index)
47.Which of the following is not method of Iterator?
a)hasNext()
b)next()
10 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c)add()
d)remove()
48.The fundamental elements that you need to create a GUI
reside in two packages, which are those?
a)java.awt and java.swing
b)java.swing and java.lang
c)java.awt and java.util
d)java.swing and java.io
49.You can now call any of the following FontMetrics method for
the object to get at the basic dimensions for font:(three correct
choice)
a)int getAscent()
b)int getHoscent()
c)int getHeight()
d)int getLeading()
e)int getMexDescunt()
11 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
chapter-18
1. Which of these packages contains all the classes and methods
required for event handling in Java?
a) java.applet
b) java.awt
c) java.event
d) java.awt.event
2. What is an event in delegation event model used by Java
programming language?
a) An event is an object that describes a state change in a source.
b) An event is an object that describes a state change in
processing.
c) An event is an object that describes any change by the user and
system.
d) An event is a class used for defining object, to create events.
3. Which of these methods are used to register a keyboard event
listener?
a) KeyListener()
12 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
b) addKistener()
c) addKeyListener()
d) eventKeyboardListener()
4. Which of these methods are used to register a mouse motion
listener?
a) addMouse()
b) addMouseListener()
c) addMouseMotionListner()
d) eventMouseMotionListener()
5. What is a listener in context to event handling?
a) A listener is a variable that is notified when an event occurs.
b) A listener is a object that is notified when an event occurs.
c) A listener is a method that is notified when an event occurs.
d) None of the mentioned
6. Event class is defined in which of these libraries?
a) java.io
13 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
b) java.lang
c) java.net
d) java.awt
7. Which of these methods can be used to determine the type of
event?
a) getID()
b) getSource()
c) getEvent()
d) getEventObject()
8. Which of these class is super class of all the events?
a) EventObject
b) EventClass
c) ActionEvent
d) ItemEvent
9. Which of these events will be notified if scroll bar is
manipulated?
14 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a) ActionEvent
b) ComponentEvent
c) AdjustmentEvent
d) WindowEvent
10. Which of these events will be generated if we close an
applet’s window?
a) ActionEvent
b) ComponentEvent
c) AdjustmentEvent
d) WindowEvent
11. Which of these functions is called to display the output of an
applet?
a) display()
b) print()
c) displayApplet()
d) PrintApplet()
15 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
12. Which of these methods is a part of Abstract Window Toolkit
(AWT) ?
a) display()
b) print()
c) drawString()
d) transient()
13. Which of these modifiers can be used for a variable so that it
can be accessed from any thread or parts of a program?
a) transient
b) volatile
c) global
d) No modifier is needed
14. Which of these operators can be used to get run time
information about an object?
a) getInfo
b) Info
c) instanceof
16 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d) getinfoof
15. What is the Message is displayed in the applet made by this
program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20);
}
}
a) A Simple Applet
b) A Simple Applet 20 20
c) Compilation Error
d) Runtime Error
16. What is the length of the application box made by this
program?
import java.awt.*;
17 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
import java.applet.*;
public class myapplet extends Applet {
public void paint(Graphics g) {
g.drawString("A Simple Applet", 20, 20);
}
}
a) 20
b) 50
c) 100
d) System dependent
17. Which of these events is generated when a button is pressed?
a) ActionEvent
b) KeyEvent
c) WindowEvent
d) AdjustmentEvent
18. Which of these methods can be used to obtain the command
name for invoking ActionEvent object?
18 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a) getCommand()
b) getActionCommand()
c) getActionEvent()
d) getActionEventCommand()
19. Which of these are integer constants defined in ActionEvent
class?
a) ALT_MASK
b) CTRL_MASK
c) SHIFT_MASK
d) All of the mentioned
20. Which of these methods can be used to know which key is
pressed?
a) getKey()
b) getModifier()
c) getActionKey()
d) getActionEvent()
19 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
21. Which of these methods can be used to know the degree of
adjustment made by the user?
a) getValue()
b) getAdjustmentType()
c) getAdjustmentValue()
d) getAdjustmentAmount()
22. Which of these events will be notified if scroll bar is
manipulated?
a) ActionEvent
b) ComponentEvent
c) AdjustmentEvent
d) WindowEvent
View Answer
23. Which of these constant value will change when the button at
the end of scroll bar was clicked to increase its value?
a) BLOCK_DECREMENT
b) BLOCK_INCREMENT
20 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c) UNIT_DECREMENT
d) UNIT_INCREMENT
24. Which of these events is generated when the size os an event
is changed?
a) ComponentEvent
b) ContainerEvent
c) FocusEvent
d) InputEvent
25. Which of these events is generated when the component is
added or removed?
a) ComponentEvent
b) ContainerEvent
c) FocusEvent
d) InputEvent
26. Which of these methods can be used to obtain the reference
to the container that generated a ContainerEvent?
21 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a) getContainer()
b) getContainerCommand()
c) getActionEvent()
d) getContainerEvent()
27. Which of these methods can be used to get reference to a
component that was removed from a container?
a) getComponent()
b) getchild()
c) getContainerComponent()
d) getComponentChild()
28. Which of these are integer constants of ComponentEvent
class?
a) COMPONENT_HIDDEN
b) COMPONENT_MOVED
c) COMPONENT_RESIZE
d) All of the mentioned
22 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
29. FocusEvent is subclass of which of these classes?
a) ComponentEvent
b) ContainerEvent
c) ItemEvent
d) InputEvent
30. Which of these methods can be used to know the type of
focus change?
a) typeFocus()
b) typeEventFocus()
c) isTemporary()
d) isPermanent()
31. Which of these is superclass of ContainerEvent class?
a) WindowEvent
b) ComponentEvent
c) ItemEvent
d) InputEvent
23 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
32. Which of these events is generated when the a window is
closed?
a) TextEvent
b) MouseEvent
c) FocusEvent
d) WindowEvent
33. Which of these methods can be used to obtain the
coordinates of a mouse?
a) getPoint()
b) getCoordinates()
c) getMouseXY()
d) getMouseCordinates()
34. Which of these methods can be used to change location of an
event?
a) ChangePoint()
b) TranslatePoint()
c) ChangeCordinates()
24 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d) TranslateCordinates()
35. Which of these are integer constants of TextEvent class?
a) TEXT_CHANGED
b) TEXT_FORMAT_CHANGED
c) TEXT_VALUE_CHANGED
d) TEXT_sIZE_CHANGED
36. Which of these methods is used to obtain the object that
generated a WindowEvent?
a) getMethod()
b) getWindow()
c) getWindowEvent()
d) getWindowObject()
37. MouseEvent is subclass of which of these classes?
a) ComponentEvent
b) ContainerEvent
c) ItemEvent
25 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d) InputEvent
38. Which of these methods is used to get x coordinate of the
mouse?
a) getX()
b) getXCoordinate()
c) getCoordinateX()
d) getPointX()
39. Which of these are constants defined in WindowEvent class?
a) WINDOW_ACTIVATED
b) WINDOW_CLOSED
c) WINDOW_DEICONIFIED
d) All of the mentioned
40. Which of these is superclass of WindowEvent class?
a) WindowEvent
b) ComponentEvent
c) ItemEvent
26 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d) InputEvent
41. Which of these packages contains all the event handling
interfaces?
a) java.lang
b) java.awt
c) java.awt.event
d) java.event
42. Which of these interfaces handles the event when a
component is added to a container?
a) ComponentListener
b) ContainerListener
c) FocusListener
d) InputListener
43. Which of these interfaces define a method
actionPerformed()?
a) ComponentListener
27 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
b) ContainerListener
c) ActionListener
d) InputListener
44. Which of these interfaces define four methods?
a) ComponentListener
b) ContainerListener
c) ActionListener
d) InputListener
45. Which of these interfaces define a method
itemStateChanged()?
a) ComponentListener
b) ContainerListener
c) ActionListener
d) ItemListener
46. Which of these methods will respond when you click any
button by mouse?
28 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a) mouseClicked()
b) mouseEntered()
c) mousePressed()
d) All of the mentioned
47. Which of these methods will be invoked if a character is
entered?
a) keyPressed()
b) keyReleased()
c) keyTyped()
d) keyEntered()
48. Which of these methods is defined in MouseMotionAdapter
class?
a) mouseDragged()
b) mousePressed()
c) mouseReleased()
d) mouseClicked(
29 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
49. Which of these are constants defined in WindowEvent class?
a) WINDOW_ACTIVATED
b) WINDOW_CLOSED
c) WINDOW_DEICONIFIED
d) All of the mentioned
50. Which of these is superclass of all Adapter classes?
a) Applet
b) ComponentEvent
c) Event
d) InputEvent
51. Which of these events is generated when computer gains or
losses input focus?
a) ComponentEvent
b) ContainerEvent
c) FocusEvent
52.What is the method of object------getSource().
30 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
53.When we want to change our cursor into hand cursor ----call
mouseEntered()method.
54.When Sketcher application starts which kind of constraint of
specify-----
DEFAULT_ELEMENT_TYPE.
55.Which command to compile Sketcher------ javac -classpath
“.;C:/Packages” Sketcher.java
56. The ColorListener class works in the same way as the-----------
- TypeListener class.
57. A Name is ------String type object.
58. A small icon is a—Ajavax.swing.Icon object to be displayed
on a toolbar button
59. setEnabled, isEnabled() method returns------Boolean type
argument.
6o.The sketch program is implementing semantic event listener
to support the ------menu bar in sketchFrame class.
61. Default close operation as----- EXIT_ON_CLOSE
62. javax.swing.AbstractAction class can ------ implements the
Action interface.
63. The AbstractAction class has -------Three constructors.
31 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
( AbstractAction(), AbstractAction(String name),
AbstractAction(String name, Icon icon).
64.Action interface extends ------ZThe ActionListener Interface.
65.The properties class is stay -----java.util.package.
66. we have use == for the element type-----when ID are type
are int.
67. When the cursor is moved out of area occupied by the
component-------Then called mouseExited() method.
68.JButton field of a -----lottery Class.
69.Which method need to add the toolbar to the application
window?
a. getContentPane().add(toolBar,BorderLayout.NORTH);
b. setContentPane().add(toolBar,BorderLayout.NORTH);
c. getContentPane().add(toolTip,BorderLayout.NORTH);
d. getContentPane().set(toolBar,BorderLayout.NORTH);
70.JToolbar came from which class/package?
a. javax.swing
b.javax.awt.event
32 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c.java.lang
d.java.util
71.which method is used adding buttons to a toolbar?
a. toolbar.get(button);
b. toolbar.set(button);
c.toolbar.add(button);
d. button.add(button);
72.javax.swing.Icon here Icon is a
a.class
b.interface
c.method
d.constructor
73.GIF means
a.Graphics Interchange Format
b. Geographics Interchange Format
c. Graphics Inheritage Format
33 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d.Graphics Inherit Format
74.which mehod need To set an icon to a menu item
a.addIcon();
b.setIcon();
c.getIcon();
menu.addIcon();
75.which method use to Disabling Actions?
a.getEnabled();
b.isEnabled(true);
c.isEnabled(false);
d.setEnabled(false);
76. An event for a component can be handled by the component
object itself.
a.true
b.false
34 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
77. A user interaction generates an event in the context of a
component.
a.true
b.false
78. Both low-level and semantic events can arise simultaneously.
a.true
b.false
79. A listener interface for low-level events requires several
event-handling methods to be
implemented.
a.true
b.false
80. A listener interface for semantic events declares a --------------
event-handling method.
a.single
b.multiple
35 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
81. An adapter class defines a set of -----------methods for one or
more low-level event interfaces.
a.empty metod
b.abstract method
c.calling method
d.set method
82. Events in applications and in applets are handled in exactly the
same way.
a.true
b.false
83. An Action object is an object of a class that implements the
Action interface.
a.Action class
b.abstract class
c.Action interface
36 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
84. Action objects can be used to create menu items and
associated toolbar buttons.
a.true
b.false
85. The state of both the JMenuItem and JButton objects created
from an Action object is determined
by the state of the Action object.
a.true
b.false
86.what is need to be implemented to receive the event from the
button?
a.ActionListener interface.
87.when actionPerformed() method in the ActionListener is
called?
a.then the event occurs.
37 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
88. Which of the following are true?
A. The event-inheritance model has replaced the event-delegation
model.
B. The event-inheritance model is more efficient than the event-
delegation model.
C. The event-delegation model uses event listeners to define the
methods of event-handling classes.
D. The event-delegation model uses the handleEvent( ) method to
support event handling.
89. Which of the following is the highest class in the event-
delegation model?
java.util.EventListener
java.util.EventObject
java.awt.AWTEvent
java.awt.event.AWTEvent
90. When two or more objects are added as listeners for the
same event, which
38 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
A. listener is first invoked to handle the event?
B. The first object that was added as listener.
C. The last object that was added as listener.
D. There is no way to determine which listener will be invoked
first.
It is impossible to have more than one listener for a given event.
91. Which of the following components generate action events?
Buttons
Labels
Check boxes
Windows
92. Which of the following are true?
A TextField object may generate an ActionEvent.
A TextArea object may generate an ActionEvent.
A Button object may generate an ActionEvent.
A MenuItem object may generate an ActionEvent.
93. Which of the following are true?
39 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
The MouseListener interface defines methods for handling mouse
clicks.
The MouseMotionListener interface defines methods for handling
mouse clicks.
The MouseClickListener interface defines methods for handling
mouse clicks.
The ActionListener interface defines methods for handling the
clicking of a button.
Ans : a and d.
94. Suppose that you want to have an object eh handle the
TextEvent of a TextArea object t. How should you add eh as the
event handler for t?
t.addTextListener(eh);
eh.addTextListener(t);
addTextListener(eh.t);
addTextListener(t,eh);
Ans : a.
95.What is the preferred way to handle an object’s events in
Java 2?
40 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
Override the object’s handleEvent( ) method.
Add one or more event listeners to handle the events.
Have the object override its processEvent( ) methods.
Have the object override its dispatchEvent( ) methods.
Ans : b.
96. Which of the following are true?
A component may handle its own events by adding itself as an
event listener.
A component may handle its own events by overriding its event-
dispatching method.
A component may not handle oits own events.
A component may handle its own events only if it implements the
handleEvent( ) method.
Ans : a and b.
97. The event delegation model, introduced in release 1.1 of the
JDK, is fully compatible with the event model.
True
False
41 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
98.A component subclass that has executed enableEvents( ) to
enable processing of a certain kind of event cannot also use an
adapter as a listener for the same kind of event.
True
False
99.How many kinds of Adapter classes?
a.5
b.6
c.7
100. which removes the listener passed as an
Which is also for use by a
Container object?
a. void removePropertyChangeListener(
PropertyChangeListener listener);
b.void addPropertyChangeListener( PropertyChangeListener
listener)
101. JButton, JToggleButton, JcheckBox
42 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a. ItemEvent
b. AdjustmentEvent
102. when called windowStateChanged(WindowEvent e)?
a. Called when the window state changes.
b. Called when the window loses the focus.
103. windowDeiconified(WindowEvent e)
a. Called when a window is minimized and reduced
to an icon
b. Called when a window is restored from an icon
XML Questions
XML Multiple Choice Questions and Answers
1. What does XML stand for?
A. eXtra Modern Link
B. eXtensible Markup Language
C. Example Markup Language
D. X-Markup Language
43 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
2. What is the correct syntax of the declaration which defines
the XML version?:
A. <xml version="A.0" />
B. <?xml version="A.0"?>
C. <?xml version="A.0" />
D. None of the above
3. Which statement is true?
A. All the statements are true
B. All XML elements must have a closing tag
C. All XML elements must be lower case
D. All XML documents must have a DTD
4. Is it easier to process XML than HTML?
A. Yes
B. No
C. Somtimes
D. Cant say
5. Which of the following programs support XML or XML
44 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
applications?:
A. Internet Explorer 5.5
B. Netscape D.7
C. RealPlayer.
D. both A and B
6. Kind of Parsers are
A. well-formed
B. well-documented
C. non-validating and validating
D. none of the above
7. Well formed XML document means
A. it contains a root element
B. it contain an element
C. it contains one or more elements
D. must contain one or more elements and root element must
contain all other elements
8. Comment in XML document is given by
A. <?-- -->
45 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
B. <!-- --!>
C. <!-- -->
D. </-- -- >
9. When processing an output XML, "new line" symbols
A. are copied into output "as is", i.e. "CR+LF" for Windows, CR
for Macintosh, LF for Unix.
B. are converted to single LF symbol
C. are converted to single CR symbol
D. are discarded
10. Which of the following strings are a correct XML name?
A. _myElement
B. my Element
C. #myElement
D. None of the above
11. Which of the following strings are a correct XML name?
A. xmlExtension
B. xslNewElement
C. XMLElement#123
46 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
D. All
12. Which of the following XML fragments are well-formed?
A. <?xml?>
B. <?xml version="A.0"?>
C. <?xml encoding="JIS"?>
D. <?xml encoding="JIS" version="A.0"?>
13. What are the predefined attributes
A. xml:lang
B. xml:space
C. both
D. none.
Ans: C
14. Kind of Parsers are
A. well-formed
B. validating
C. non-validating
D. Both B & C
47 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
15. Valid XML document means (most appropriate)
A. the document has root element
B. the document contains atleast one or more root element
C. the XML document has DTD associated with it & it
complies with that DTD
D. Each element must nest inside any enclosing element
property
16. XML uses the features of
A. HTML
B. XHTML
C. VML
D. SGML
17. XML document can be viewed in
A. IE C.0
B. IE B.0
C. IE 6.0
D. IE X.0
18. There is a way of describing XML data, how?
48 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
A. XML uses a DTD to describe the data
B. XML uses XSL to describe data
C. XML uses a description node to describe data
D. Both A and C
19. What does DTD stand for?
A. Direct Type Definition
B. Document Type Definition
C. Do The Dance
D. Dynamic Type Definition
20. DTD includes the specifications about the markup that
can be used within the document, the specifications consists
of all EXCEPT
A. the browser name
B. the size of element name
C. entity declarations
D. element declarations
21. Which of the following XML documents are well-formed?
A. <firstElement>some text goes here
49 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
<secondElement>another text goes here</secondElement>
</firstElement>
B. <firstElement>some text goes here</firstElement>
<secondElement> another text goes here</secondElement>
C. <firstElement>some text goes here
<secondElement> another text goes here</firstElement>
</secondElement>
D. </firstElement>some text goes here
</secondElement>another text goes here
<firstElement>
22. Which of the following XML fragments are well-formed?
A. <myElement myAttribute="someValue"/>
B. <myElement myAttribute=someValue/>
C. <myElement myAttribute=’someValue’>
D. <myElement myAttribute="someValue’/>
23. How can we make attributes have multiple values:
A. <myElement myAttribute="value1 value2"/>
B. <myElement myAttribute="value1"
myAttribute="value2"/>
C. <myElement myAttribute="value1, value2"/>
50 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
D. attributes cannot have multiple values
24. Which of the following XML fragments are well-formed?
A. <myElement myAttribute="value1 <= value2"/>
B. <myElement myAttribute="value1 & value2"/>
C. <myElement myAttribute="value1 > value2"/>
D. None of the above
25. The use of a DTD in XML development is:
A. required when validating XML documents
B. no longer necessary after the XML editor has been
customized
C. used to direct conversion using an XSLT processor
D. a good guide to populating a templates to be filled in when
generating an XML document automatically
26. Parameter entities can appear in
A. xml file
B. dtd file
C. xsl file
D. Both 1 and 2
51 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
27. Attribute standalone="no" should be included in XML
declaration if a document:
A. is linked to an external XSL stylesheet
B. has external general references
C. has processing instructions
D. has an external DTD
28. In XML
A. the internal DTD subset is read before the external DTD
B. the external DTD subset is read before the internal DTD
C. there is no external type of DTD
D. there is no internal type of DTD
29. Disadvantages of DTD are
(i)DTDs are not extensible
(ii)DTDs are not in to support for namespaces
(iii)there is no provision for inheritance from one DTDs to
another
A. (i) is correct
52 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
B. (i),(ii) are correct
C. (ii),(iii) are correct
D. (i),(ii),(iii) are correct
30. To use the external DTD we have the syntax
A. <?xml version=”A.0” standalone=”no”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
B. <?xml version=”A.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
(3 )<?xml version=”A.0” standalone=”no”?>
<! DOCTYPE DOCUMENT “order.dtd”?>
D. <?xml version=”A.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
31. To add the attribute named Type to the <customer> tag
the syntax will be
A. <customer attribute Type=”exelent”>
B. <customer Type attribute =”exelent”>
C. <customer Type attribute_type=”exelent”>
D. <customer Type=” exelent” >
53 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
32. The syntax for parameter entity is
A. <! ENTITY % NAME DEFINITION>
B. < ENTITY % NAME DEFINITION>
C. <! ENTITY $ NAME DEFINITION>
D. < ENTITY % NAME DEFINITION>
33. You can name the schema using the name attribute like
A. <schema attribute=”schema1”>
B. <schema nameattribute=”schema1”>
C. <schema nameattri=”schema1”>
D. <schema name=”schema1”>
34. The default model for complex type, in XML schemas for
element is
A. textOnly
B. elementOnly
C. no default type
D. both 1 & 2
35. Microsoft XML Schema Data types for Hexadecimal digits
representating octates
54 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
A. UID
B. UXID
C. UUID
D. XXID
Ans: C
36. A schema describes
(i) grammer
(ii) vocabulary
(iii) structure
(iv) datatype of XML document
A. (i) & (ii) are correct
B. (i),(iii) ,(iv) are correct
C. (i),(ii),(iv) are correct
D. (i),(ii),(iii),(iv) are correct
37. Microsoft XML Schema Data Type “ boolean” has values
A. True ,False
B. True ,False or 1,0
C. 1,0
D. any number other then zero and zero
55 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
38. Simple type Built into Schema “ data’ represent a data in
A. MM-DD-YY
B. Dd-MM-YY
C. YY-MM-DD
D. YYYY-MM-DD
39. In simple Type Built into XML schema Boolean type holds
A. True, False
B. 1,0
C. both A. & B.
D. True/False and any number except 0
40. In simple type built into XML schema type flat has single
precision of ________ floating point
A. 16 bit
B. 32 bit
C. 8 bit
D. 4 bit
41. The XML DOM object is
56 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
A. Entity
B. Entity Reference
C. Comment Reference
D. Comment Data
42.Attribute of the document interface in DOM is/are
(i)doctype
(ii)implementation
(iii)documentElement
which are read only attributes
A. (i) only
B. (ii) only
C. (ii),(iii) only
D. all
43. The default model for complex type, in XML schemas for
element is
A. textOnly
B. elementOnly
C. no default type
D. both a & b
57 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
44. To create a choise in XML schemas, we use the
A. <xsd:select> element
B. <xsd:multi> element
C. <xsd:choise> element
D. <xsd:single> element
45. The XML DOM object is
A. Entity
B. Entity Reference
C. Comment Reference
D. Comment Data
46. To create a data island we use the _____________HTML
element
A. <XML>
B. <dataisland>
C. <Island>
D. <XMLIsland>
47. To Bind the HTML elements with DSO we use _________
attribute
58 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
A. DATASOURCE
B. DATAFIELD
C. DATASRC
D. DATAFLD
48. To bind the HTML element <INPUT> Type in text with the
datasource “ dsoCustomer” we use
A. <INPUT TYPE=”TEXT” DATAFIELD=”#dsoCustomer”>
B. <INPUT TYPE=”TEXT” DATASRC=” dsoCustomer”>
C. <INPUT TYPE=”TEXT” DATASRC=” #dsoCustomer” >
D. <INPUT TYPE=”TEXT” DATAFLD=” #dsoCustomer”>
49. XML DSOs has the property for the number of pages of
data the recordset contains
A. count
B. number
C. pageCount
D. pageNumber
50. Whats so great about XML?
A. Easy data exchange
59 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
B. High speed on network
C. Only B.is correct
D. Both A. & B.
51. For XML document to be valid
A. document need to be well formed also
B. document need not to be well formed
C. document need to be well formed & valid
D. document validity has no relationship with well
formedness
52. A textual object is a well formed XML document if
(i) Taken as a whole it matches the production labeled
document.
(ii) Each of the parsed entity which is referenced directly or
indirectly within the document can be well formed
A. (i) is correct
B. (ii)is correct
C. both are correct
53. <?xml version=” A.0” standalone=” yes” encoding=”UTF-
60 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
8” ?>
A. it shows that the version is A.0
B. shows thatit is standalone
C. the standalone is wrong
D. version attribute is not in XML
54. The attribute used to define a new namespace is
A. XMLNS
B. XmlNameSpace
C. Xmlns
D. XmlNs
55. To match the root node in XMLT transform the syntax will
be
A. <xsl:template match=”Document”>
B. <xsl:template match=”Root”>
C. <xsl:template match=”RootNode”>
D. <xsl:template match=” /”>
56. To match the specific XML elements child like of parent
element is the syntax will be
A. <xsl:template match=”PLANET_NAME”>
B.<xsl:template match=”PLANET/NAME”>
C. <xsl:template match=”/NAME”>
61 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
D. <xsl:template match=”//”>
57. PI in XML specification stands for
A. C.14
B. priceless instruction
C. processing instruction
D. polymorphic inheritance
58. A validating XML application should be used when:
A. the design demands that all elements use both start and
end tags
B. missing or out-of-place elements could cause application
errors
C. attribute values cannot refer to external entity references
D. High performance is an important architectural constraint
59. A DSO operates like
(a) data simulation object at server side
(b) dynamic source object at client side
(c) data source object at client side
(d) data simulation object at client side
60. The XSL formating object use to format a list is
A. list-block
62 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
B. list-item
C. list-item-body
D. list-item-label
61. The attribute used to define a new namespace is
A. XMLNS
B. XmlNameSpace
C. Xmlns
D. XmlNs
62. Identify the most accurate statement about the
application of XML:
A. XML must be used to produce XML and HTML output.
B. XML cannot specify or contain presentation information.
C. XML is used to describe hierarchically organized
information.
D. XML performs the conversion of information between
different e-business applications.
63. The XSl formatting object which formats the data and
caption of a table is
A. table
B. table-content
C. table-text
63 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
D. none of the above
64. The XSL formating object which holds the content of the
table body
A. table
B. table-body
C. table-content
D. table-footer
65. The XSL formatting object which formats the data in a
table
A. table
B. table-body
C. title
D. table-content
66. The XSL formating object use to hold the content of the
label of a list item is
A. list-block
B. list item
C. list-item-body
D. list-item-label
67. The XSL formating object use to hold the contents of the
64 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
body of a list item is
A. list-block
B. list item
C. list-item-body
D. list-item-label
68. XSL has formatting object “ block”
A. is not supported in XSL
B. generates a block level reference area
C. create a display block
D. groups global declarations for a style sheet
69. XSL has “ block container” for formating the document
A. to create a display block to format the titles
B. to create a display block to format the paragraphes
C. to create a display block to format the headlines & figures
D. to create a block level reference area
70. The syntax for writing the minimum occurrence for an
element is
A. <xsd:element ref=” note” min=” 0” />
B. <xsd:elements ref=” note” min=” 0” />
C. <xsd:elements ref=” note” minOccur=”0” />
D. <xsd:elements ref=” note” minOccurs=” 0” />
65 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
71. The syntax for writing default values for element is
A. <xsd:element name=”max” type=” xsd:integer” value=”
100” />
B. <xsd:element name=”max” type=” xsd:integer” fixValue=”
100” />
C. <xsd:element name=”max” type=” xsd:integer” default=”
100” />
D. <xsd:element name=”max” type=” xsd:integer”
defaultval=” 100” />
72. To use XSLT in an XML system:
A. the input and output of the XSLT processor must be
unparsed XML documents
B. the input and output of the XSLT processor must be a
hierarchical tree representing an XML document
C. the XSLT processor must be called from a web agent
D. the XSLT processor must be given the DTD as well as the
XML document instance
73. What is the role of the XPath language in XSL processing?
A. XPath identifies the order or path of processing to be
followed as the XSL language is processed
B. XPath identifies locations in XML data to be transformed in
66 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
the source tree and the locations to be generated in output
tree specified in XSL translation prescriptions
C. XPath identifies the path to be followed in the execution of
XSL translation prescriptions
D. XPath specifies which XSL transform files are to be used in
the translation of XML
74. Which statement correctly describes the capabilities of
the XSLT language?
A. XSLT uses the DTD to determine how XML documents will
be translated
B. XSLT specifies how a hierarchical trees, representable by an
XML document may be translated into non-hierarchical
formats
C. XSLT specifies how a hierarchical tree, representable by an
XML document, may be translated into another hierarchical
tree, also representable by an XML document
D. XSLT specifies the formatting style to be used to render an
XML document
75. XSLT processors accept as input:
A. an XML conforming document file and an XSLT
specification file
B. only an XML document
67 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
C. only an XSLT specification
D. either an XML document or an XSLT specification
76. The transformation of XML document in to another type
of document by XSLT can be done by
(i)In the server
(ii)In the client
(iii)With a separate program
A. only(i) & (ii)
B. only (ii) & (iii)
C. all are correct
D. only (i) & (iii)
77: To match the root node in XMLT transform the syntax will
be
A. <xsl:template match=”Document”>
B. <xsl:template match=”Root”>
C. <xsl:template match=”RootNode”>
D. <xsl:template match=” /” >
78: To match the specific XML elements in XMLT the syntax
for given name “ rootnode” is
A. <xsl:template match=” root”>
68 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
B. <xsl:template match=” /”>
C. <xsl:template match=” rootnode” >
D. <xsl:template match=” //”>
79. To match the specific XML elements child like of parent
element is the syntax will be
A. <xsl:template match=”PLANET_NAME”>
B. <xsl:template match=” PLANET/NAME” >
C. <xsl:template match=” /NAME”>
D. <xsl:template match=” //”>
80. InXSLT style sheet we have syntax to match elements with
id as (if id is “ change” )
A. <xsl:template match=” id(‘change’)” >
B. <xsl:template match=” (change)”>
C. <xsl:template match=” change”>
D. <xsl:template match-id=”Change”>
81. To match the text node (in XSLT) the syntax will be
A. <xsl:template match=” text”>
B. <xsl:template match-text=” text”>
C. <xsl:template match=text( )>
D. <xsl:template match=” text( )” >
69 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
82. An element declaration specifies
A. a single markup element
B. zmarkup elements
C. markup data
D. the document data
83. Well formed XML document means(most appropriate)
A. it contains a root element
B. it contain an element
C. it contains one or more elements
D. must contain one or more elements and root element
must contain all other elements
84: Which of the following specify that the order and content
of "membership" is not important
A. <!ELEMENT membership NORULE>
B. <!ELEMENT membership EMPTY>
C. <!ELEMENT membership ALL>
D. <!ELEMENT membership ANY>
85: Which of the following is used to specify the attribute list
of an element
A. ATTLIST
B. ?ATTLIST
70 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
C. !ATTLIST
D. #ATTLIST
86: Which of the following instruct the browser which
stylesheet to use
A. <xml-stylesheet type="text/xsl" href="cd.xsl">
B. <xml-stylesheet type="text/xsl" xsl="cd.xsl">
C. <?xml-stylesheet type="text/xsl" href="cd.xsl"?>
D. <?xml-stylesheet type="text/xsl" xsl="cd.xsl"?>
88: Which of the following XSLT Patterns is used to match any
descendant nodes
A. /
B. //
C. .
D. ..
89: Which of the following XSLT Patterns is used to match the
parent node
A. /
B. //
C. .
D. ..
71 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
90: Which of the following is a valid XSLT iteration command
A. for
B. for-all
C. for-each
D. in-turn
91.What is an advantage of XML compared to HTML?
A. XML works on more platforms.
B. XML is suited to using Web pages as front ends to
databases.
C. XML was designed for portable phones.
D. XML is simpler to learn than HTML.
92.The following best describes the development of XML.
A. XML developed from HTML because WEB browsers
became more powerful.
B. XML is designed as a replacement because SGML can not
be used for document development.
C. XML builds on HTMLs ability to provide content to virtually
any audience by adding the power of intelligent content.
D. XML is the modern replacement for HTML and SGML,
taking the good points from each, making both of those
languages obsolete.
72 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
93. The correct priority for implementing XML based IETMs is
:
A. Develop DTD, conduct a pilot project, create a modular
library, train staff.
B. Train staff, convert legacy documents, develop DTD, create
modular library.
C. Conduct pilot program, train staff, create modular library,
develop DTD
D. Conduct pilot program, train staff, develop DTD, convert
documents, purchace XML tools.
94. Which of the following statements is true:
A. XML is a direct subset of SGML
B. SGML is an application of HTML
C. XML is a kind of dynamic HTML
D. XHTML is XML rewritten in HTML
5. SGML and XML are the same thing
95. What is a qualified name?
A. Any name conforming to the XML Names specification
B. A name having prefix and local name separated by a colon
C. A name applying only to qualified elements and attributes
D. None of the above
73 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
96. What is a NCName
A. A Non-Common Name
B. A Non-Conforming Name
C. A Non-Colonized Name
D. None of the above
97. Which of the following statements about XML schemas is
incorrect?
A. All XML documents must have a schema
B. Schemas can specify integer values
C. Schemas are defined by XSD tag
D. They offer more flexibility than DTDs
E. Schemas provide data oriented data types
98. What is the default namespace
A. The namespace used by default when no namespace is
declared
B. The namespace used when two or more namespaces are
referenced
C. A namespace that is referenced with the xmlns attribute,
but without a prefix
D. None of the above
74 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
99.What is an XML namespace?
A. A set of names applied to specific spaces within an XML
document, such as the head and body
B. A set of names representing a specific XML vocabulary
C. A set of names for XML documents pertaining to a
particular vocabulary
D. None of the above.
100. From what set of names do NCNames derive?
A. Any combination of characters allowable in XML
B. Any names conforming to XML Names, minus the colon
C. Any names for elements and attributes within the DTD to
which the namespace refers
D. None of the above.
101. What does XML stand for?
a. Extra Modern Link
b. Extensible Markup Language
c. Example Markup Language
d. X-Markup Language
75 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
102. What is the correct syntax of the declaration which defines
the XML version?
a. <xml version="A.0"/>
b. <?xml version="A.0"/?>
c. <?xml version="A.0"/>
d. none of the above
103. SGML stands for
a. Standard Generalized Markup Language
b. Structured General Markup Language
c. Standard Graphics Mapping Language
d. Standard General Markup Link
104. HTML and XML are markup languages
a. Specially development for the web
b. Are based on SGML
c. Are versions of SGML
d. Independent of SGML
76 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
105. XML stands for
a. Extra Markup Language
b. Excellent Markup Links
c. Extended Markup Language
d. Extended Marking Links
106. XML uses
a. user define tags
b. pre-defined tags
c. both predefined and user-defined tags
d. Extended tags used in HTML and makes them powerful
107. In order to interpret XML documents one should
a. Use standardized tags
b. Have a document type definition which defines the tags
c. Define the tags separately
d. Specify tag filename
108. The advantages of XML over HTML are
77 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
i. It allows processing of data stored in web-pages
ii. It uses meaningful tags which aids in understanding the nature
of a document
iii. Is simpler than HTML It separates presentation and structure of
document
a. i,ii and iii
b. i,ii and iv
c. ii,iii and iv
d. i,iii and iv
109. XSL definition is used along with XML definition to specify
a. The data types of the contents of XML document
b. The presentation of XML document
c. The links with other documents
d. The structure of XML document
110. DTD definition is used along with XML to specify
a. The data types of the contents of XML document
b. The presentation of XML document
78 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c. The links with other documents
d. The structure of XML document
111. Which statement is true about XML?
a. Elements may nest but not overlap.
b. Elements may have multiple attributes with the same name.
c. Quoting attributes is optional.
d. Element names can have spaces.
e. All of the above.
112. Which is used to describe the hierarchy of data in an XML
document?
a. XSL
b. CSS
c. DTD
d. A data node.
e. None of the above.
113. What does DTD stand for?
79 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a. Direct Type Definition
b. Document Type Data
c. Document Type Definition
d. Data to Document
e. Dynamic Type
114. Which statement is true?
a. All XML documents must have a DTD.
b. All XML elements must be lower case.
c. All XML elements must have a closing tag.
d. All the statements are true.
e. None of the above.
115. Which statement is not true?
a. XML elements must be properly nested.
b. XML documents must have a root tag.
c. XML tags are case sensitive.
d. XML documents must be well-formed.
e. XML tag names must start with "xml"
80 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
116. Which is not a correct name for an XML element?
a. <h1 >
b. <1dollar>
c. <Note>
d. <note>
e. <noTE>
117. Which is not a correct name for an XML element?
a. <NAME>
b. <age>
c. <first name>
d. <phone_number>
e. <PhoneNumber>
118. What is a correct way of referring to a stylesheet called
"mystyle.xsl" ?
a. <?style with type="text/xsl" href="mystyle.xsl" ?>
b. <stylesheet type="text/xsl" href="mystyle.xsl" />
81 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c. <link type="text/xsl" href="mystyle.xsl" />
d. <?xml-stylesheet type="text/xsl" href="mystyle.xsl" ?>
e. None of the above.
119. Every XML document must be valid.
a. True
b. False
120. Every XML document must be well formed.
a. True
b.False
121. Every XML document must have an associated DTD or
schema.
a. True
b. False
122. The following XML code is well-formed.
<?xml version="1.0"?>
82 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
<editors>
<editor>David Shapiro</editor>
<editor>Rodney Jackson</editor>
<editor></editor>
</editors>
a. True
b. False
123. The following XML code is well-formed.
<?xml version="1.0"?>
<editors>
<editor first="David" last="Shapiro" />
<editor first="Rodney" last="Jackson" />
</editors>
a. True
b. False
124. Every XML document represents a tree hierarchy of
elements.
83 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a. True
b. False
125. XML attribute values must always be enclosed in quotes.
a. True
b. False
126. XML's goal is to replace HTML.
a. True
b. False
127. Is this a correct XML document?
<?xml version="1.0"?>
<message>
<to>John</to>
<from>Jane</from>
<subject>Training Course</subject>
<body>Contact Computer Education Techniques, Inc.</body>
</message>
84 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a. True
b. False
128. Is this a correct XML document?
<?xml version="1.0"?>
<to>John</to>
<from>Jane</from>
<subject>Training Course</subject>
<body>Contact Computer Education Techniques, Inc.</body>
a. True
b. False
129. XML preserves white spaces.
a. True
b. False
130. Is this a correct XML document?
<?xml version="1.0"?>
<message>
85 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
<to age="45">John</to>
<from>Jane</from>
</note>
a. True
b. False
131. Is this a correct XML document?
<?xml version="1.0"?>
<message>
<to age=29>John</to>
<from>Jane</from>
</message>
a. True
b. False
132. Is it easier to process XML than HTML?
a. Yes
b. No
c. Sometimes
86 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d. None
133. Kind of parsers are
a. well-formed
b. well-documented
c. non-validating and validating
d. none of the above
134. well-formed XML documents means
a. it contains a rooot element
b. it contains an element
c. it contains one or more element
d. must contain one or more elements and root element must
contain all other elements
135. Which of the following strings are a correct XML name?
a. _myElement
b. my Element
c. #myElement
87 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d. None of the above
136. Which of the following strings are a correct XML name?
a. xmlExtension
b. xslNewElement
c. XMLElement#123
d. All
137. What are the predefined attributes
a. xml:lang
b. xml:space
c. both
d. none
138. Valid XML document means (most appropriate)
a. the document has root element
b. the document contains at least one or more root element
c. the XML document has DTD associated with it & it complies
with that DTD
88 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d. Each element must nest inside any enclosing element property
139. XML uses the features of
a. HTML
b. XHTML
c. VML
d. SGML
140. XML document can be viewed in
a. IE 3.0
b. IE 2.0
c. IE 6.0
d. IE X.0
141.There is a way of describing XML data, how?
a. XML uses a DTD to describe the data
b. XML uses XSL to describe data
c. XML uses a description node to describe data
d. Both a and d
89 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
142. What does DTD stand for?
a. Direct Type Definition
b. Document Type Definition
c. Do The Dance
d. Dynamic Type Definition
143. DTD includes the specifications about the markup that can be
used within the document, the specifications consists of all
EXCEPT
a. the browser name
b. the size of element name
c. entity declarations
d. element declarations
144. Which of the following XML fragments are well-formed?
a. <myElement myAttribute="someValue"/>
b. <myElement myAttribute=someValue/>
c. <myElement myAttribute=’someValue’>
90 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d. <myElement myAttribute="someValue’/>
145. How can we make attributes have multiple values:
a. <myElement myAttribute="value1 value2"/>
b. <myElement myAttribute="value1" myAttribute="value2"/>
c. <myElement myAttribute="value1, value2"/>
d. attributes cannot have multiple values
146. Which of the following XML fragments are well-formed?
a. <myElement myAttribute="value1 <= value2"/>
b. <myElement myAttribute="value1 & value2"/>
c. <myElement myAttribute="value1 > value2"/>
d. None of the above
147. The use of a DTD in XML development is:
a. required when validating XML documents
b. no longer necessary after the XML editor has been customized
c. used to direct conversion using an XSLT processor
91 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d. a good guide to populating a templates to be filled in when
generating an XML document automatically
148. Parameter entities can appear in
a. xml file
b. dtd file
c. xsl file
d. Both a and b
149. Attribute standalone="no" should be included in XML
declaration if a document:
a. is linked to an external XSL stylesheet
b. has external general references
c. has processing instructions
d. has an external DTD
150. In XML
a. the internal DTD subset is read before the external DTD
b. the external DTD subset is read before the internal DTD
92 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c. there is no external type of DTD
d. there is no internal type of DTD
151. To use the external DTD we have the syntax
a. <?xml version=”1.0” standalone=”no”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
b. <?xml version=”1.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
c. <?xml version=”1.0” standalone=”no”?>
<! DOCTYPE DOCUMENT “order.dtd”?>
d. <?xml version=”1.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
152. To add the attribute named Type to the <customer> tag the
syntax will be
a. <customer attribute Type=”exelent”>
b. <customer Type attribute =”exelent”>
c. <customer Type attribute_type=”exelent”>
d. <customer Type=” exelent” >
93 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
153. The syntax for parameter entity is
a. <! ENTITY % NAME DEFINITION>
b. < ENTITY % NAME DEFINITION>
c. <! ENTITY $ NAME DEFINITION>
d. < ENTITY % NAME DEFINITION>
154. You can name the schema using the name attribute like
a. <schema attribute=”schema1”>
b. <schema nameattribute=”schema1”>
c. <schema nameattri=”schema1”>
d. <schema name=”schema1”>
155. The default model for complex type, in XML schemas for
element is
a. textOnly
b. elementOnly
c. no default type
d. both 1 & 2
94 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
156. Microsoft XML Schema Data types for Hexadecimal digits
representating octates
a. UID
b. UXID
c. UUID
d. XXID
157. Microsoft XML Schema Data Type “ boolean” has values
a. True ,False
b. True ,False or 1,0
c. 1,0
d. any number other then zero and zero
158. Simple type Built into Schema “ data’ represent a data in
a. MM-DD-YY
b. Dd-MM-YY
c. YY-MM-DD
d. YYYY-MM-DD
95 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
159. In simple Type Built into XML schema Boolean type holds
a. True, False
b. 1,0
c. both a and b
d. True/False and any number except 0
160. In simple type built into XML schema type flat has single
precision of ________ floating point
a. 16 bit
b. 32 bit
c. 8 bit
d. 4 bit
161. The XML DOM object is
a. Entity
b. Entity Reference
c. Comment Reference
d. Comment Data
96 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
162.Attribute of the document interface in DOM is/are
(i)doctype
(ii)implementation
(iii)documentElement
which are read only attributes
a. only i
b. only ii
c. only ii,iii
d. all
163. The default model for complex type, in XML schemas for
element is
a. textOnly
b. elementOnly
c. no default type
d. both a & b
164. To create a choise in XML schemas, we use the
97 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a. <xsd:select> element
b. <xsd:multi> element
c. <xsd:choise> element
d. <xsd:single> element
165. The XML DOM object is
a. Entity
b. Entity Reference
c. Comment Reference
d. Comment Data
166. To create a data island we use the _____________HTML
element
a. <XML>
b. <dataisland>
c. <Island>
d. <XMLIsland>
98 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
167. To Bind the HTML elements with DSO we use _________
attribute
a. DATASOURCE
b. DATAFIELD
c. DATASRC
d. DATAFLD
168. XML DSOs has the property for the number of pages of data
the recordset contains
a. Count
b. Number
c. pageCount
d. pageNumber
169. Whats so great about XML?
a. Easy data exchange
b. High speed on network
c. Only b
d. Both a,b
99 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
170. XSL stands for
a. Extensible Style sheet Language
b. Extensible Style Language
c. Exclusive Stylesheet Language
d. Exclusive Style Language
171. XML tabs are .............................
a. case sensitive
b. case insnesitive
c. easy
d. deficult
172. In XML the attribute value must always be quoted with
............
a. double quotes
b. single quotes
c. both a and b
d. name of attributes
100 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
173. Elements from the HTML namespace are displayed as they
would in .......................
a. DHTML
b. XML
c. HTML
d. DXML
174. Comment in XML document is given by
a. <? ---->
b. <! ----!>
c. <! ---->
d. </ ---->
175. For XML document to be valid
a. document need to be well formed also
b. document need not to be well formed
c. document need to be well formed & valid
d. document validity has no relationship with well formedness
101 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
176. A textual object is a well formed XML document if
i. Taken as a whole it matches the production labeled document.
ii. Each of the parsed entity which is referenced directly or
indirectly within the document can be well formed
a) (i) is correct
b) (ii) is correct
c) both are correct
177. <?xml version=” 1.0” standalone=” yes” encoding=”UTF-8” ?>
a. it shows that the version is 1.0
b. shows thatit is standalone
c. the standalone is wrong
d. version attribute is not in XML
178. The attribute used to define a new namespace is
a. XMLNS
b. XmlNameSpace
c. Xmlns
102 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d. XmlNs
179. To match the root node in XMLT transform the syntax will be
a. <xsl:template match=”Document”>
b. <xsl:template match=”Root”>
c. <xsl:template match=”RootNode”>
d. <xsl:template match=” /”>
180. To match the specific XML elements child like of parent
element is the syntax will be
a. <xsl:template match=”PLANET_NAME”>
b. <xsl:template match=”PLANET/NAME”>
c. <xsl:template match=”/NAME”>
d. <xsl:template match=”//”>
181. PI in XML specification stands for
a. priceless instruction
b. processing instruction
c. polymorphic inheritance
103 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
182. A validating XML application should be used when:
a. the design demands that all elements use both start and end
tags
b. missing or out-of-place elements could cause application errors
c. attribute values cannot refer to external entity references
d. High performance is an important architectural constraint
183. The XSL formating object use to format a list is
a. list-block
b. list-item
c. list-item-body
d. list-item-label
183. The attribute used to define a new namespace is
a. XMLNS
b. XmlNameSpace
c. Xmlns
d. XmlNs
104 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
184. Identify the most accurate statement about the application
of XML:
a. XML must be used to produce XML and HTML output.
b. XML cannot specify or contain presentation information.
c. XML is used to describe hierarchically organized information.
d. XML performs the conversion of information between different
e-business applications.
185. The syntax for writing the minimum occurrence for an
element is
a. <xsd:element ref=” note” min=” 0” />
b. <xsd:elements ref=” note” min=” 0” />
c. <xsd:elements ref=” note” minOccur=”0” />
d. <xsd:elements ref=” note” minOccurs=” 0” />
186. The syntax for writing default values for element is
a. <xsd:element name=”max” type=” xsd:integer” value=” 100” />
b. <xsd:element name=”max” type=” xsd:integer” fixValue=” 100”
/>
105 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c. <xsd:element name=”max” type=” xsd:integer” default=” 100”
/>
d. <xsd:element name=”max” type=” xsd:integer” defaultval=”
100” />
187. An element declaration specifies
a. a single markup element
b. zmarkup elements
c. markup data
d. the document data
188.What is an advantage of XML compared to HTML?
a. XML works on more platforms.
b. XML is suited to using Web pages as front ends to databases.
c. XML was designed for portable phones.
d. XML is simpler to learn than HTML.
189. Which of the following statements is true:
a. XML is a direct subset of SGML
106 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
b. SGML is an application of HTML
c. XML is a kind of dynamic HTML
d. XHTML is XML rewritten in HTML
e. SGML and XML are the same thing
107 | P a g e