Pages

Sunday, 12 February 2017

NIELIT A Level Java Solve Paper

July, 2011
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 “tear-off” answer sheet attached to the question paper, following instructions therein. (1x10)
1.1 ________ class of java.util package supports Internationalization
A) TimeZone
B) Currency
C) Locale
D) Calendar
1.2 Which one of the following is not an AWT listener interface?
A) ActionEvent
B) KeyListener
C) FocusListener
D) WindowListener

1.3 Which one of the following is the correct syntax for suggesting that the JVM performs garbage
collection?
A) System.free();
B) System.setGarbageCollection();
C) System.out.gc();
D) System.gc();
1.4 What is the purpose of method parseDouble defined in Double class?
A) The method is used to convert String to Double class, assuming that the String represents a
double.
B) The method coverts the Double object to a String.
C) The method is used to convert String to a double assuming that the String represents a
double.
D) The method converts a double to a String.

1.5 In the following jar command jar cvf jarFileName *.class*.gif, the option v is used
to ________
A) update an existing jar file.
B) verifies the jar file for the specified class and gif files.
C) generates verbose output.
D) displays the table of contents.
1.6 In Java, the collection of methods with no implementation is called ________
A) an interface
B) a static class
C) a package
D) none of the above
1.7 ________ is used internally to initialize objects when no constructor is explicitly mentioned
A) A default constructor
B) An assignment operator
C) A parameterized constructor
a) A copy constructor
1.8 The purpose of USE Case diagram of UML is ________
A) Structure and connections of components.
B) Deployment of artifacts to nodes.
C) Procedural and parallel behavior.
D) How users interact with a system.
1.9 int values[ ] = {1,2,3,4,5,6,7,8};
for(int i=0;i< X; ++i)
System.out.println(values[i]);
Referring to the above, what value for X will print from all members of array "values"?
A) 1
B) 7
C) 8
D) None of the above
1.10 Which code segment would execute the stored procedure "calculateSal()" located in a
database server?
A) Statement stmt = connection.createStatement();
stmt.execute("CALCULATESAL()");
B) CallableStatement cs = con.prepareCall("{call calculateSal }");
cs.executeQuery();
C) StoreProcedureStatement spstmt = connection.createStoreProcedure("calculateSal()");
spstmt.executeQuery();
D) PrepareStatement pstmt = connection.prepareStatement("calculateSal()");
pstmt.execute();
E) Statement stmt = connection.createStatement();
stmt.executeStoredprocedure("calculateSal()");

2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and
ENTER in the “tear-off” sheet attached to the question paper, following instructions
therein. (1x10)

2.1 JFrame is a parent class of a JPanel.
2.2 The entry point of every application in java is its main() method.
2.3 The ArrayList class provides the capability to implement a growable array of object.
2.4 In java, Object class is the root of class hierarchy.
2.5 The destroy() method of a JApplet is called more than once in its life cycle.
2.6 Assertions are a commonly used idiom for defensive programming.
2.7 The JButton object can be created with text and icon.
2.8 When using the GridBagLayout manager, each new component requires a new instance of the
GridBagConstraints class.
2.9 The combination of name, return type and order of arguments is termed as signature of method.
2.10 UML Sequence diagram is one form of interaction diagram.

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 “tear-off” answer sheet attached to the question paper, following instructions therein. (1x10)
X
Y
3.1
javax.swing package
A.
Graphics2D
3.2
In Object Oriented Programming, each package represents a
B.
paintComponent()
3.3
Array in Java
C.
drawPaint()
3.4
A method used to paint graphics in a JApplet
D.
Shape
3.5
A class for rendering 2-dimensional shapes, text and images
E.
is a set of lightweight component
3.6
An object which generates an event is known as
F.
MVC
3.7
The architecture of swing component
G.
Source Object
3.8
An object which registers itself for receiving an event.
H.
Listener Object
3.9
Generalization
I.
association
3.10
Aggregation
J.
is an object


K.
namespace.


L.
is a relationship


M.
interaction

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 “tear-off” answer sheet attached to the question paper,following instructions therein. (1x10)

A.
IOException static
B.
InvalidMarkException
C.
final
D.
javap
E.
default
F.
ResultSet
G.
private
H.
FlowLayout
I.
PreparedStatement
J.
reference
K.
SQLException
L.
ReadOnlyBufferException
M.
objects





4.1 A class declared as ________ cannot be inherited.
4.2 An object is implicitly passed to a method by ________.
4.3 The class variable is also called as a(n) ________ variable.
4.4 getNextException method belongs to ________ class.
4.5 The object of ________ class is thrown when an attempt is made to reset a buffer when its
mark is not defined.
4.6 The jdk development tool which is used as a class file disassembler is known as ________.
4.7 A SQL statement is precompiled and stored in a ________ object.
4.8 ________ is the default access modifier for instance variables in Java.
4.9 UML depicts information systems as a collection of ________.
4.10 The default layout manager of a JPanel container is ________.

PART TWO
(Answer any FOUR questions)
5.
a) What are Wrapper classes? Explain in detail.
b) What is a package? Explain the steps for creating user defined package.
c) Briefly discuss Abstraction and Encapsulation in Object Oriented Programming.
(5+5+5)
6.
a) Write a short note on following UML diagrams
i) Component diagram
ii) Deployment diagram
b) Write a short note on java.nio.ByteBuffer class.
c) What do you mean by static and dynamic typed languages? Explain in brief.
(5+5+5)
7.
a) What is an exception? Describe exception handling mechanism with example.
b) What is JDBC? Write the basic steps required to connect and process the data from a
database using JDBC.
c) What is inheritance? Write the important benefits of Inheritance.
(5+5+5)
8.
a) Explain static and dynamic method binding?
b) What is the UML Sequence diagram? Explain it with suitable example?
c) List the features provided by Swing for developing GUI Application and discuss the Swing
JTextField and JLabel components.
(5+5+5)
9.
a) What is an Applet? Discuss the applet HTML tag with its required attributes with an example.
b) What is the UML? What is its use?
c) What is a Layout Manager? Explain the following layout managers:
i) BorderLayout
ii) GridLayout
iii) FlowLayout
(5+5+5)

No comments:

Post a Comment