You are on page 1of 1

Write short notes on the following (10) marks) An Object ii Class iii. Inheritance iv.

Interface Package b)
Discuss the four basic concepts of object oriented programming? (8 marks) c) Explain the following
method overloading and method overriding (4 marks) d) What are the differences between instance
variables and static variables? (2 marks) e) What does the method nextint of class Random in java.util
package return if it is called without parameter and if it is called with an integer parameter?(1 mark)
SECTION B (Answer any three(3) questions of your choice) QUESTION 1 [25 marks] a) Discuss the ways in
which inheritance promotes software reuse, saves time during program development and helps prevent
errors(4 marks) b) Some programmers prefer not to use protected access, because they believe it breaks
the encapsulation of the superclass. Discuss the relative merits of using protected access vs. using
private access in superclass (4 marks) c) List and explain the access control modifiers in java? (5 marks)
d) Create a class named 'Member' having the following members: Data members 1. Name 2. Age 3.
Phone number 4. Address 5. Salary It also has a method named 'printSalary' which prints the salary of
the members. Two classes 'Employee' and 'Manager' inherits the 'Member' class. The 'Employee' and
'Manager' classes have data members 'specialization' and 'department' respectively. Now, assign name,
age, phone number, address and salary to an employee and a manager by making an object of both of
these classes and print the same (12 marks)

You might also like