C++ Object-Oriented Questions
C++ Object-Oriented Questions
23. List out some of the object-oriented methodologies. Object Oriented Development
(OOD) (Booch 1991,1994), Object
Oriented Analysis and Design (OOA/D) (Coad and Yourdon 1991), Object
Modelling Techniques (OMT) (Rumbaugh 1991), Object Oriented Software
Engineering (Objectory) (Jacobson 1992), Object Oriented Analysis (OOA)
(Shlaer and Mellor 1992), The Fusion Method (Coleman 1991).
delete ptr;
void PrintVal()
};
void SomeFunc(Sample x)
int main()
Sample s1 = 10;
SomeFunc(s1);
s1.PrintVal();
Method
41. What are the conditions that have to be met for a condition to be an invariant of the
class?
o The condition should hold at the end of every constructor.
o The condition should hold at the end of every mutator (non-const) operation.
42. What are proxy objects? Objects that stand for other objects are called proxy objects or
surrogates.
43. template <class t="">
44. class Array2D
45. {
46. public:
47. class Array1D
48. {
49. public:
50. T& operator[] (int index);
51. const T& operator[] (int index)const;
};
};
Array2D<float>data(10,20);
cout<<data[3][6]; // fine
52. Name some pure object oriented languages. Smalltalk, Java, Eiffel, Sather.
53. Name the operators that cannot be overloaded. sizeof, ., .*, .->, ::, ?: Salam in the
comments notes that -> can be overloaded.
56. What is a container class? What are the types of container classes?