Java(4th)May2018
Java(4th)May2018
of Pages: 02
Total No. of Questions: 07
INSTRUCTIONS TO CANDIDATES:
1. SECTION-A is COMPULSORY consisting of TEN questions carrying TWO marks each.
2. SECTION-B contains SIX questions carrying TEN marks each and students ha ve to
attempt any FOUR questions.
SECTION A
o m
.r c
1. Write a short note on the following:
a) Relational operators
b) Literals
p e o m
a .r c
c) Java virtual machine
d) Static member
e) Bitwise operators
r p e
f) Dynamic binding
b a p
rp
g) Virtual functions
h) Import
i) System Packages
j) Polymorphism
b
M-12518 Page 1 of 2
SECTION B
(4x10)
2 a) Explain the major benefits of object oriented programming? Name a few languages that
support OOP paradigm other than java.
b) Write a sample java code to explain the program structure (Document section, Package
statements, Import statements, class definition, Main method class)
3. a) What do you understand by data type? What are various kinds of data types supported
by java language? Explain each data type with the help of examples.
b) What do you understand by inheritance? Explain each type of inheritance with the help of
example and diagram.
4. a) Explain the role of constructor in Java class by considering a suitable example and also
tell a class can have maximum of how many constructors.
b) Write a program in Java to find a number in list of numbers. You are supposed to
m
use binary search algorithm for searching. Assume list of numbers is already sorted.
o
5. a) What are various kinds of loop statements supported by Java language? Explain the
.r c
functioning of each one with suitable example.
b) What is the role of friend function and friend class? Write suitable java code in support of
arguments.
p e o m
6. a) Differentiate between relational operators, conditional and logical operators. Write
.r c
example operators for each operator type.
p a
b) Write the sample java code to explain the working of visibility controls —public access,
b r
friendly access, protected access, private access.
p e
7. a) Explain the working of the exception handling mechanism in java? Write sample code to
a
throw an exception and handle it with multiple catch statements.
rp
b) How applets are different from application? Explain the applet life cycle states.
M-12518 Page 2 of 2