Advance Java MCQ
Advance Java MCQ
Advance Java MCQ
J2EE - ROUND 21
CHAPTER 17
1. What does mean by GUI-
Answer:(Graphical user interface).
1|Page
Chapter 17,18,22,23
J2EE - ROUND 21
c.point
a.yes
b.no
6|Page
Chapter 17,18,22,23
J2EE - ROUND 21
7|Page
Chapter 17,18,22,23
J2EE - ROUND 21
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
c)operation
d)inherited
9|Page
Chapter 17,18,22,23
J2EE - ROUND 21
10 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c)add()
d)remove()
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
b) addKistener()
c) addKeyListener()
d) eventKeyboardListener()
b) java.lang
c) java.net
d) java.awt
14 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a) ActionEvent
b) ComponentEvent
c) AdjustmentEvent
d) WindowEvent
15 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
16 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d) getinfoof
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
a) getCommand()
b) getActionCommand()
c) getActionEvent()
d) getActionEventCommand()
19 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
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
21 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a) getContainer()
b) getContainerCommand()
c) getActionEvent()
d) getContainerEvent()
22 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
23 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
24 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d) TranslateCordinates()
d) InputEvent
d) InputEvent
27 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
b) ContainerListener
c) ActionListener
d) InputListener
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
29 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
31 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
c.java.lang
d.java.util
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
34 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
35 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
36 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
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
37 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
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
40 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
41 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
a. ItemEvent
b. AdjustmentEvent
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
applications?:
A. Internet Explorer 5.5
B. Netscape D.7
C. RealPlayer.
D. both A and B
B. <!-- --!>
C. <!-- -->
D. </-- -- >
D. All
47 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
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
A. (i) is correct
52 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
53 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
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
A. UID
B. UXID
C. UUID
D. XXID
Ans: C
55 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
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
A. Entity
B. Entity Reference
C. Comment Reference
D. Comment Data
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
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
A. (i) is correct
B. (ii)is correct
C. both are correct
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
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=” /”>
D. <xsl:template match=”//”>
B. list-item
C. list-item-body
D. list-item-label
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
64. The XSL formating object which holds the content of the
table body
A. table
B. table-body
C. table-content
D. table-footer
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
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=” /” >
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
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>
C. !ATTLIST
D. #ATTLIST
71 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
72 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
73 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
74 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
75 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
76 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
78 | 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
a. True
b. False
a. True
b. False
<to age="45">John</to>
<from>Jane</from>
</note>
a. True
b. False
d. None
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
90 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
d. <myElement myAttribute="someValue’/>
91 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
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
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
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
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
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
a. <xsd:select> element
b. <xsd:multi> element
c. <xsd:choise> element
d. <xsd:single> element
98 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
168. XML DSOs has the property for the number of pages of data
the recordset contains
a. Count
b. Number
c. pageCount
d. pageNumber
99 | 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=” /”>
106 | P a g e
Chapter 17,18,22,23
J2EE - ROUND 21
107 | P a g e