OOPS Interview Questions
Questions Answers Views Company eMail

How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?

IntraLogic,

1 7849

Contrast OOP and SOA. What are tenets of each?

Wipro,

1 10388

why c++ is called OOPS? waht is inherutance? what is compiler?

5 9454

What normal C constructs work differently in C++?

2 2950

Why and when is a virtual destructor needed?

5 11256

Why a "operator=(...)" when there is a copy ctor?

2 3041

what is object slicing?

L&T, Wipro,

9 36585

who is the founder of c++?

ONGC, Hexaware,

15 20892

//what is wrong with the programme?? #include template class dd { first i; public: void set(); void print(); }; void dd< first>:: set() { cin>>i; } void dd< first>::print() { cout<<"\n"<g; g.set(); g.print(); }

1 2209

what is an instance of a class

5 3815

What is a class?

Infosys, TCS, Thylak,

32 9385

What is an object?

HCL,

13 5863

What is the difference between an object and a class?

3 3647

What is the difference between class and structure?

7 5702

What is public, protected, private?

Satyam,

6 10394


Post New OOPS Questions


Un-Answered Questions { OOPS }

Give two or more real cenario of virtual function and vertual object

783


diff between Virtual mathod and abstract method?

1051


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

191


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

665


Get me an image implementation program.

498


officer say me - i am offered to a smoking , then what can you say

552


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

4158


Question In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Question Submitted By :: Sunil Kumar I also faced this Question!! Rank Answer Posted By Re: In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest. Answer # 1 use copy constructors 0 Shanthila There is something to be taken care in destructor, in copy constructor, suppose the memory is assigned to the embedded member object pointer with the parameter passed value, but if some other objects of different class also are pointing to this memory, then if some one deletes the object then this class member pointer object will become dangling, or if the object is not deleted properly then there will be memory leak. Please suggest the design change required to handle or avoid this situation

620


2. Give the different notations for the class.\

488


class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash

562


How Do you Code Composition and Aggregation in C++ ?

19159


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

420


Objective The objective of this problem is to test the understanding of Object-Oriented Programming (OOP) concepts, in particular, on encapsulation. Problem Description Create a program for managing customer’s bank accounts. A bank customer can do the following operations: 1. Create a new bank account with an initial balance. 2. Deposit money into his/her account. 3. Withdraw money from his/her account. For this operation, you need to output “Transaction successful” if the intended amount of money can be withdrawn, otherwise output “Transaction unsuccessful” and no money will be withdrawn from his/her account. Input The input contains several operations and is terminated by “0”. The operations will be “Create name amount”, “Deposit name amount”, or “Withdraw name amount”, where name is the customer’s name and amount is an integer indicating the amount of money. There will be at most 100 bank accounts and they are all created on the first month when the bank is opening. You may assume that all account holders have unique names and the names consist of only a single word. Output The output contains the transaction result of withdrawal operations and the final balance of all customers after some withdrawal and deposit operations (same order as the input). Sample Input Create Billy 2500 Create Charlie 1000 Create John 100 Withdraw Charlie 500 Deposit John 899 Withdraw Charlie 1000 0

637


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

630


when to use 'mutable' keyword and when to use 'const cast' in c++

580