Académique Documents
Professionnel Documents
Culture Documents
Test Paper
Programming in C++
~sample( ) { cout<<"destructed:"; }
};
int main( )
{
try
{
sample s;
}
catch(int x){ cout<<"caught:"; }
return 0;
}
5) Consider a class having int* i, floa* j, float m, static int x as data members and
void f1( ), static void f2( ) as member functions. In a simple object model layout, size
of the object will be
a) 24 bytes
b) 12 bytes
c) 4 bytes
d) 16 bytes
assume VC++ compiler and 32 bit computing.
7) class A has two int data members and one static int member. It has two virtual
functions void f1( ) and void f2( ). Class B is derived from A having one double*
member. The size of object of B class will be
a) 16 bytes
b) 28 bytes
c) 24 bytes
d) 20 bytes
c) code reusability
d) accumulating state of objects
11) following statement/statements are true about template method design pattern
a) define the skeloton of an algorthim in an operation, deffering some steps
to subclass.
b) technique for code reuse
c) controls the object accessibility
d) abstract out the object creation details
class C
{ public: C( ) {cout<< ”C”;}
private:
B bb;
};
int main( )
{
C cc;
}
15) To share the object in memory by different client objects, following memory
management technique is used
a) copy-to-write
b) reference counting
c) singleton
d) all of above
-Creating Software Architects-