Adamas University: Supplementary Examination: March 2021
Adamas University: Supplementary Examination: March 2021
1. a) Which is a technique in Java in which a class can have any number of constructors that differ in
parameter lists?
b) Which method cannot be overridden?
c) Which class cannot be instantiated (can’t create object)?
d) Which modifier cannot be used for constructors?
e) Define the term Byte code
GROUP –B
Answer any three of the following 3 ×5=15
GROUP –C
Answer any two of the following 2 ×10=20
6.
a. Write the difference between this and super keyword.
b. Define a class Point with two fields x and y each of type double. Also , define a method
distance(Point p1, Point p2) to calculate the distance between points p1 and p2 and return the value in
double. Complete the code segment given below. Use Math.sqrt( ) to calculate the square root.
[2+8]
Page 1 of 2
7.
a. Explain how Dynamic Method Dispatch overcomes the problem of method overriding.
b. Write a class with the volume () using method overloading that computes the volume of
a cube, a sphere and a cuboid.
Volume of a cube (vc ) =s*s*s
Volume of a sphere (vs) = 4/3*pi*r*r*r
Volume of a cuboid (vcd)= l*b*h
Write a main method to create an object of a class and call the above member method
[4+6]
8.
________________
Page 2 of 2