January, 2014
A10.1-R4: INTRODUCTION TO OBJECT ORIENTED PROGRAMMING THROUGH JAVA
PART ONE
(Answer all the questions)
1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)
1.1 Methods used to obtain information about an object are known as
A) accessor methods
B) setter methods
C) mutator methods
D) none of the above
1.2 Which of the following is the mutable wrapper class?
A) Integer
B) BigInteger
C) Boolean
D) Character
1.3 Range and behavior for a primitive type in Java is to be supported by
A) Java Virtual Machine
B) Operating system
C) User
D) All of the above
1.4 Which of the following is the method of the interface Enumeration?
A) keys()
B) hasMoreElement()
C) nextElement()
D) elements()
1.5 Java’s exception handling mechanism is meant to handle
A) only compile time errors
B) only syntax errors
C) only runtime errors
D) both runtime and compile time errors.
A10.1-R4 Page 2 of 5 January, 2014
1.6 Which of the following swing component is a source of ItemEvent?
A) JPopupMenu
B) JLabel
C) JTextField
D) JComboBox
1.7 All collection classes are available in ________ package.
A) java.io
B) java.util
C) java.awt
D) java.lang
1.8 In a UML diagram, generalization is indicated by
A) Arrow from subclass to super class
B) Arrow from super class to subclass
C) Line with a diamond at super class
D) Line with a diamond at subclass
1.9 What is the output of the following program?
class MyClassTest
{ public static void main(String[] args)
{ int y;
System.out.println("Begin Main");
y=testMethod(); System.out.println("End Main");
}
static float testMethod()
{ System.out.println("Inside TestMethod()"); return 10;
}
}A) 10
B) 10.0
C) Compilation Error
D) None of the above
1.10 Which of the following is a built in dialog that lets a user select a file?
A) JFileInputChooser
B) JFileSelector
C) JFileInputSelector
D) JFileChooser
2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the “OMR” answer sheet supplied with the question paper, following instructions therein. (1x10)
2.1 An abstract Data type is a term referring to an abstract class.
2.2 Generics are implemented by Type Erasure.
2.3 JRE cannot be installed independent of JDK.
2.4 The instanceof operator results in the value of type boolean.
2.5 The default layout manager for javax.swing.JApplet class is BorderLayout.
2.6 The readObject() is a method of Serializable interface.
2.7 An inner class can have static members.
2.8 An exception in Java is represented by instances of the Throwable class or any of its
sub-classes.
2.9 In order to capture the events when mouse moves, the MouseListener is used.
2.10 System.in is a predefined stream variable of public, final and static type.
3. Match words and phrases in column X with the closest related meaning/
word(s)/phrase(s) in column Y. Enter your selection in the “OMR” answer sheet supplied
with the question paper, following instructions therein. (1x10)
X
Y
3.1
Event is generated by
A.
Interaction
3.2
To arrange components as row/columns
B.
ActionListener
3.3
Frame
C.
GridLayout
3.4
FileWriter extends
D.
Source object
3.5
Aggregation
E.
immutable object
3.6
DataOutputStream
F.
reverse() method
3.7
String
G.
Association
3.8
Panel is the immediate super class of
H.
OutputStreamWriter
3.9
StringBuffer
I.
BorderLayout
3.10
Collaboration
J.
JApplet
K.
OutputStream
L.
Applet
M.
Assertion
X
|
Y
|
||
3.1
|
Event is generated by
|
A.
|
Interaction
|
3.2
|
To arrange components as row/columns
|
B.
|
ActionListener
|
3.3
|
Frame
|
C.
|
GridLayout
|
3.4
|
FileWriter extends
|
D.
|
Source object
|
3.5
|
Aggregation
|
E.
|
immutable object
|
3.6
|
DataOutputStream
|
F.
|
reverse() method
|
3.7
|
String
|
G.
|
Association
|
3.8
|
Panel is the immediate super class of
|
H.
|
OutputStreamWriter
|
3.9
|
StringBuffer
|
I.
|
BorderLayout
|
3.10
|
Collaboration
|
J.
|
JApplet
|
|
|
K.
|
OutputStream
|
|
|
L.
|
Applet
|
|
|
M.
|
Assertion
|
4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list
below. Enter your choice in the “OMR” answer sheet supplied with the question paper,
following instructions therein. (1x10)
A.
|
java.sql.Driver
|
B.
|
JIT
|
C.
|
draw3DString
|
D.
|
Archive
|
E.
|
drawString
|
F.
|
Unicode
|
G.
|
Class
|
H.
|
void
|
I.
|
Sequence
|
J.
|
java.sql.DriverManager
|
K.
|
Delegation
|
L.
|
Case
|
M.
|
java.util.Date
|
|
|
|
|
No comments:
Post a Comment