B.E./B.Tech. DEGREE EXAMINATION, APRIL/MAY 2011
Electrical and Electronics Engineering
CS 2311—OBJECT ORIENTED PROGRAMMING(Common to Instrumentation and
Control Engineering andElectronics and Instrumentation Engineering)
Time : Three hours Maximum: 100marks Answer ALL questions.
PART A—(10 × 2 = 20marks)
1. Define abstraction and encapsulation.
2. When will the destructors be called? Is it implicit or explicit?
3. List the operators that cannot be overloaded.
4. What are pure virtual functions? Where are they used?
5. Define Exception. Give example.
6. State the purpose of namespaces with an example.
7. What is byte code? Mention its advantage.
8. What are packages?
9. Define interface. State its use.
10. What is thread? How does it differ from a process?
PART B—(5 × 16 = 80marks)
11. (a) Explain in detail about Class, Objects, Methods and Messages.
(b) Write a C++ program to define overloaded constructor to performstring
initialization, string copy and string destruction.
12. (a) Write a C++ program to implement C = A + B , C = A − B andC = A ∗ B where
A , B and C are objects containing a int value(vector).
(b) Explainrun timepolymorphism with example program in C++.
13. (a) Explain the different types of streams and various formatted I/O inC++.
(b) Explain the various file handling mechanisms in C++.
14. (a) Write a java programto create two singledimensional arrays,initialize them and add
them; store the result in another array.
(b) Write a java program to perform allstring operationsusing the Stringclass.
15. (a) Explain in detail about the inheritance mechanism in Java withexample
(b) Explain with example program,exception handlingin java
OBJECT ORIENTED PROGRAMMING CS2311 ANNA UNIVERSITY PREVIOUS QUESTION PAPER APRIL/MAY 2012 Reviewed by Rejin Paul on 6:50 AM Rating: