18CS45 Model Question Paper-1 With Effect From 2019-20 (CBCS Scheme) Usn: Fourth Semester B.E. Degree Examination Object Oriented Concepts
18CS45 Model Question Paper-1 With Effect From 2019-20 (CBCS Scheme) Usn: Fourth Semester B.E. Degree Examination Object Oriented Concepts
18CS45 Model Question Paper-1 With Effect From 2019-20 (CBCS Scheme) Usn: Fourth Semester B.E. Degree Examination Object Oriented Concepts
USN :
Note: Answer any FIVE full questions, choosing at least ONE question from each MODULE
Module - 1
1 a. How do namespaces helps in preventing pollution of the global namespace. (05 marks)
b. List and explain any four features of object oriented program (05 marks)
c. Explain the following terms
i) Access specifiers
ii) Polymorphism (10 marks)
OR
2 a. Can you overload constructor and destructor? Justify with suitable example. (05 marks)
b. Define friend function. Explain how one can bridge two classes using friend
Function. Write a C++ program to find the sum of two numbers using friend
Function. Assume two variables are present in two different class. (10 marks)
c. What is a reference variable? Explain. Also write a program in C++ to swap
two variables of type complex and display the values before and
after swapping. (05 marks)
Module - 2
3 a. How “ compile once and run anywhere” is implemented in Java, explain. (05 marks)
b. Write a Java program to sum only first five elements of the array using
for each loop. (05 marks)
c. Explain the operations of the following operators with example.
i) % ii) >>> iii) && iv) + (concatenation operator) v) || (10 marks)
OR
4 a. List and explain Java buzzwords. (10 marks)
b. What is type casting? Illustrate with an example, what is meant by automatic
type casting. (05 marks)
c. How to declare and accept values for two dimensional arrays in Java.
Explain with a suitable example. (05 marks)
Module - 3
5 a. Describe the various levels of access protections available for packages and
their implications with suitable examples. (10 marks)
b. Compare and contrast method overloading and method overriding with
suitable example. (06 marks)
c. Explain with example, when constructors are called in class hierarchy. (04 marks)
OR
6 a. Explain usage of super keyword in Java with suitable examples. (05 marks)
b. Define Exception. Write a program which contains one method which will
throw IllegalAccessException and use proper exception handlers so that
exception should be printed in the calling function. (10 marks)
c. Define and explain different types of inheritance in Java. (05 marks)