Sunday 9 April 2017

NIELIT A Level Solve Paper
Core Java Solved July, 2015
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 What does the expression 1.0 / 0.0 return?
A) Double.NaN
B) 0.0
C) Run time exception is generated
D) Double.INFINITY

1.2 Which method of a Class class is used to determine the name of a class represented by this
Class object as a String?
A) getName()
B) getClass()
C) getResource()
D) toString()
1.3 Which Java command disassembles a class file and prints out the package, protected, and
public fields and methods of the classes passed to it to stdout?
A) javadoc
B) javap
C) javaw
D) javah
1.4 If a class inheriting an abstract class does not define all of its method then it will be known as?
A) final
B) simple
C) abstract
D) static
1.5 Which of these keywords must be used to monitor for exceptions?
A) finally
B) throw
C) catch
D) try

1.6 Which of the following creates a List with 3 visible items and multiple selection disabled?
A) new List(3, false)
B ) new List(true ,3)
C) new List(3, true)
D) new List(false,3)
1.7 What is called the process of extracting common characteristics from two or more classes and
combining them into a generalized superclass?
A) Inheritance
B) Generalization
C) Specialization
D) Realization
1.8 What is the process by which we can control what parts of a program can access the members
of a class?
A) Polymorphism
B) Abstraction
C) Encapsulation
D) Recursion
1.9 What is the output of the following program?
public class TestingDemo
{
     public static void main(String args[]) {
               try {
                       System.out.print("Hello" + " " + 1 / 0);
                    }
               catch(Exception e) {
                         System.out.println("India");
                      }
            }
}
A) Hello
B) India
C) Compilation Error
D) Hello India
1.10 Which one of the following methods of DataInputStream is used to read integer representation
of next available byte input?
A) read()
B) readLine()
C) readUTF()
D) mark()

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 A HTML file can have multiple applet tag elements.
2.2 ResultSet.TYPE_SCROLL_INSENSITIVE constant indicates that the ResultSet object type is
scrollable and generally sensitive to changes to the data that underlies the ResultSet.
2.3 Private members of class can be inherited by a sub class, and become protected members in
sub class.
2.4 In Java, it is necessary to use new operator to initialize an array.
2.5 An anonymous class has a single super type either a class or an interface.
2.6 setDefaultCloseOperation() method is used to set the close operation for JFrame based frame.
2.7 In an Event Handling mechanism, a listener is a method that is notified when an event occurs.
2.8 An (non-local) inner class that is a member of an outer class may be declared as private.
2.9 LDAP is a lightweight client-server protocol for accessing directory services.
2.10 In Composition relationship child objects does not have their lifecycle without Parent object.

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
nextElement() method
A.
java.util.Enumeration
3.2
Object class
B.
BorderLayout
3.3
Collaboration
C.
FlowLayout
3.4
Interface deals with an Applet
D.
java.util.Iterator
3.5
Aggregation
E.
Interaction
3.6
Window class
F.
AppletContext
3.7
Panel class
G.
java.lang package
3.8
separator field
H.
AppletConfig
3.9
next() method
I.
java.io.File
3.10
Date class
J.
Association


K.
java.util package


L.
Recursim


M.
CLASS PATH

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.
String
B.
List
C.
FontMetrics
D.
EventObject
E.
AdjustmentEvent
F.
setBounds()
G.
StringBuffer
H.
ComponentEvent
I.
Graphics
J.
Set
K.
null
L.
Font
M.
Read File





4.1 ________ data types is used to store command line arguments.
4.2 The ________ interface provides support for ordered collections of objects.
4.3 ________ class is super class of all the events.
4.4 ________ objects are input to the paint() method.
4.5 The readLine() method returns ________ when it has reached the end of a file.
4.6 The implementation-specific properties like ascent, descent of a font object is implemented by
________.
4.7 ________ objects are mutable.
4.8 The ________ interface provides support for collections of unique objects.
4.9 ________ event is notified if scroll bar is manipulated.
4.10 ________ method of the Component class is used to set the position and size of a component.

PART TWO
(Answer any FOUR questions)

5.
a) Explain in detail about method overloading and method overriding with example.
b) Explain the purpose of following diagrams in UML.
i) Class Diagram
ii) Use Case Diagram
(7+8)
6.
a) What is a CLASSPATH? How can we set the CLASSPATH in Window and Linux Operating
Systems? Explain with example.
b) Discuss the Swing MVC architecture.
c) What are the adapter classes? Describe the following adapter classes.
i) ContainerAdapter
ii) FocusAdapter
(5+5+5)
7.
a) Explain the Java keywords static and final.
b) Write a short note on Character Stream classes.
c) What are Wrapper classes? Explain Autoboxing and Unboxing in brief.
(5+5+5)
8.
a) What do you mean by the static and the dynamic typed languages? Explain in brief.
b) What is an interface and how will you go about implementing an interface? Explain with
example.
c) Explain the Component and Container classes of java.awt package.
(5+5+5)
9.
a) Explain packages in object oriented paradigms? Give any one example of package diagram.
b) Explain the steps required to connect and process the data from a database using JDBC.
(7+8)

Download PDF

1 comment: