You are on page 1of 9

CS2311 OBJECT ORIENTED PROGRAMMING

QUESTION BANK
PART- A UNIT - 1
1.A.1 Define abstraction and encapsulation M/J 2012 A/M 2011
1.A.2 When will the destructors be called? Is it implicit or explicit? M/J 2012
1.A.3 What is data encapsulation? M/J 2010
1.A.4 What are the benefits of. OOP language? M/J 2010
1.A.5 With respect to C++ distinguish objects from classes. N/D 2010
1.A.6 Write a copy constructor for class date (assume mm, dd, yy as its members). N/D 2010
1.A.7 What is the difference between a pointer and a reference? N/D 2011
1.A.8 What are copy constructors? N/D 2011
1.A.9 Define abstraction and encapsulation A/M 2011
1.A.10 When will the destructors be called? Is it implicit or explicit? A/M 2011
PART- A UNIT - 2
2.A.1 List the operators that cannot be overloaded M/J 2012
2.A.2 What are pure virtual functions? Where are they used? M/J 2012
2.A.3 What is meant by file access specifier? M/J 2010
2.A.4 What is dynamic initialisation of objects? M/J 2010
2.A.5 What is encapsulation? Do friend functions violate encapsulation? N/D 2010
2.A.6 How are virtual functions declared in C++? N/D 2010
2.A.7 What is a friend function? N/D 2011
2.A.8 What is a virtual base class? N/D 2011
2.A.9 List the operators that cannot be overloaded A/M 2011
2.A.10 What are pure virtual functions? Where are they used? A/M 2011
PART- A UNIT - 3
3.A.1 Define Exception. Give example. M/J 2012
3.A.2 State the purpose of namespaces with example. M/J 2012
3.A.3 Name few operators which can't be overloaded? M/J 2010
3.A.4 What is abstract class? M/J 2010
3.A.5 What are IO streams? Give an example. N/D 2010
3.A.6 What is the purpose of the STL (Standard Template Library)? N/D 2010
3.A.7 What are manipulators? how do you create a one? N/D 2011
3.A.8 What is the difference between function template and a template function? N/D 2011
3.A.9 Define Exception. Give example. A/M 2011
3.A.10 State the purpose of namespaces with example. A/M 2011
PART - A UNIT - 4
4.A.1 What is byte code? M/J 2012
4.A.2 What are packages? M/J 2012
4.A.3 If a = -25 after shifting it two times on its left what would be the value? What is the extra
precaution one has to take care before evaluating this while coding in Java? M/J 2010
4.A.4 Define method with reference to Java. How to call it? M/J 2010
4.A.5 Give two examples for java modifiers. N/D 2010
4.A.6 What is the purpose of the getBytes( ) method? N/D 2010
4.A.7 What is an abstract class? N/D 2011
4.A.8 Under which contexts would you use final and finally? N/D 2011
4.A.9 What is byte code? A/M 2011
4.A.10 What are packages? A/M 2011
PART - A UNIT - 5
5.A.1 Define interface. State its use. M/J 2012
5.A.2 What is thread? M/J 2012
5.A.3 Give the life cycle of a thread. M/J 2010
5.A.4 What is Applet tag? M/J 2010
5.A.5 Give a sample statement for parselnt( ) and give comments for the statement. N/D 2010
5.A.6 What are the two ways of creating java threads? N/D 2010
5.A.7 How is the keyword super used in java? N/D 2011
5.A.8 What are wrapper classes in java? N/D 2011
5.A.9 Define interface. State its use. A/M 2011
5.A.10 What is thread? A/M 2011
PART- B UNIT 1
1.B.1 Explain in detail about Class, Objects, Methods and Messages A/M 2011
1.B.2 Write a C++ program to define overloaded constructor to perform string initialization,
string copy and string destruction. A/M 2011
1.B.3 Discuss on basic concepts of Object Oriented Programming? N/D 2011
1.B.4 Write a c++ program that will ask for a temperature in Fahrenheit and display it?
1.B.5 Illustrate the concept of function overloading to find the maximum of two number.
1.B.6 What are inline functions? Write a sample code to explain?
1.B.7 Write a C++ program to perform 2D matrix operations as follows: N/D 2010
1.B.8 Define class MATRIX, use appropriate constructor(s). (5)
1.B.9 Define methods for the following two matrix operations terminate and transpose. (6)
A main program to demonstrate the use of the MATRIX class and methods. (5)
1.B.10 Explain the features of object oriented programming. Describe how each of these is
implemented in C++ and Java.
1.B.11 How to create your own exceptions? Illustrate it with a small program coded in Java. (6)
1.B.12 Explain in detail about Class, Objects, Methods and Messages M/J 2012
1.B.13 Write a C++ program to define overloaded constructor to perform string initialization,
string copy and string destruction. M/J 2012
PART - B UNIT 2
2.B.1 Write a C++ program to implement C=A+B, C = A-B and C=A*B where A B and C are
objects containing a int value (vector). A/M 2011
2.B.2 Explain run time polymorphism with example program. A/M 2011
2.B.3 Create a class that contain and data member. Overload all the four arithmetic operators so
that they operate on the objects of that class? N/D 2011
2.B.4 Describe the syntax of the different forms of inheritance in c++
2.B.5 What are virtual function? Explain with a suitable program.
2.B.6 What is dynamic binding? How is it achieved?
2.B.7 Write a C++ program as follows to perform arithmetic operations on Rational numbers of
type a/b, where a and b are integers. N/D 2010
2.B.8 Define a class by Rational Number.
2.B.9 Use operator overloaded methods for addition and subtraction. (6)
2.B.10 Write a main program to demonstrate the use of this class and its methods. (4) Give a
sample output.
2.B.11 What is meant by inheritance? Explain with examples, the various types of inheritance
supported in C ++.
2.B.12 What is method overloading? Illustrate it with a program to find area of
rectangle and square, (8) M/J 2010
2.B.13 Modify the above program such that the concept of passing objects as parameter to
methods. (8)
2.B.14 Write a program in Java illustrating ladder if else statement to process the result of
statements. (8)
If average mark = 65 First Class
75 Distinction
- 50 Second Class
= 40 Third Class
Otherwise failed.
2.B.15 Use switch statement to read month and print it out. Code it in Java. (8)
2.B.16 Write a C++ program to implement C=A+B, C = A-B and C=A*B where A B and C are
objects containing a int value (vector). M/J 2012
2.B.17 Explain run time polymorphism with example program. M/J 2012
PART - B UNIT 3
3.B.1 Explain the various types of stream and various formatted I/O in c++. A/M 2011
3.B.2 Explain the various file handling mechanisms in c++. A/M 2011
3.B.3 Explain the feature of I/O system supported in C++ N/D 2011
3.B.4 Write a program containing a possible exception. Use a try block and throw it and a catch
block to handle it properly.
3.B.5 Write a program that reads a name from the keyboard into three separate string objects and
then concatenates them into a new string object + operator and append() function.
3.B.6 List the major categories of containers supported by STL.
3.B.7 Write a C++ program to demonstrate file handling as follows: get strings as input from the
user, store them in a file, retrieve them and display them. N/D 2010
3.B.8 Explain the exception handling mechanism available in C++ with suitable examples.
3.B.9 List the applications of Object Oriented Programming. (4) M/J 2010
3.B.10 Discuss on basic concepts of Object Oriented Programming. (8)
3.B.11 Give general structure of C++ program? (4)
3.B.12 How the manipulators are used to make unformatted input/output operations to formatted
one? (8)
3.B.13 Write short notes on inline functions and default arguments (4 + 4)
3.B.14 Explain the various types of stream and various formatted I/O in c++.
3.B.15 Explain the various file handling mechanisms in c++. M/J 2012
PART - B UNIT 4
4.B.1 Write a java program to create two single dimensional array, initialize them and add them,
store the result in another array. A/M 2011
4.B.2 Write a java program to perform all string operations using String class. A/M 2011
4.B.3 Describe the structure of a typical java program and give the steps to execute it. N/D 2011
4.B.4 Explain the importance of JVM in JRE.
4.B.5 Create a complex number class in java. The class should have a constructor and methods
to add, sub and multiply two complex numbers, and to return the real and imaginary parts.
4.B.6 What are packages? How are they created and used?
4.B.7 Write a menu-based java program that can calculate the area of a triangle, circle or square,
based on the user's choice. N/D 2010
4.B.8 Explain the Virtual Machine concept with reference to Java.
4.B.9 What are the advantages of polymorphism? (3) M/J 2010
4.B.10 How is function overloading enhancing programming art and style? Illustrate with an
example. (7)
4.B.11 Why is type conversion? How does it help programmers? (6)
4.B.12 What are the various types of Inheritance? Discuss any one with illustration. (10)
4.B.13 Discuss the rules of operator overloading. (6)
4.B.14 Write a java program to create two single dimensional array, initialize them and add
them, store the result in another array. M/J 2012
4.B.15 Write a java program to perform all string operations using String class. M/J 2012
4.B.16 Code a program in Java to illustrate the use of interface which calculates the simple
interest and compound interest. (10) M/J 2010
4.B.17 How to implement interface? Also explain how interface in Java help to realize the
functionality of multiple inheritance. (6) M/J 2010
4.B.18 Discuss on Java Applets. (10)
PART - B UNIT 5
5.B.1 Explain in detail about inheritance with example program in java language. A/M 2011
5.B.2 Explain with example program exception handling in java. A/M 2011
5.B.3 Describe the three different types of inheritance with an example java program in each.
N/D 2011
5.B.4 Describe the concept of interface with the syntax.
5.B.5 Write a java program to demonstrate how to read and write data to a file.
5.B.6 What is thread? How do you create threads?
5.B.7 Write a java class called _student' with name, Marks of 3 subjects and total Marks. Write
another class named _calculate that gets the Marks of the student and calculates the total
Marks and displays the result (pass or fail). N/D 2010
5.B.8 Explain the following with examples from Java. (2 x 8=16)
I. Streams and IO
II. Java threads.
5.B.9 How can you design a class? How to access data members? How is the message
Communication done to access data members of other classes? (8) M/J 2010
5.B.10 Explain with example how you can use a common friend function to exchange the private
values of 2 classes. (8)
5.B.11 How to invoke a constructor? Passing arguments could be done with parameterized
constructor? Illustrate it. How to overload constructors? (10)
5.B.12 Describe the importance of destructors. (6)
5.B.13 Explain in detail about inheritance with example program in java language. M/J 2012
5.B.14 Explain with example program exception handling in java. M/J 2012

You might also like