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 8521

Contrast OOP and SOA. What are tenets of each?

Wipro,

1 11481

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

5 10185




What normal C constructs work differently in C++?

2 3090

Why and when is a virtual destructor needed?

5 11566

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

2 3214

what is object slicing?

L&T, Wipro,

9 38115

who is the founder of c++?

ONGC, Hexaware,

15 21711




//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 2292

what is an instance of a class

5 3984

What is a class?

Infosys, TCS, Thylak,

32 9969

What is an object?

HCL,

13 6273

What is the difference between an object and a class?

3 3748

What is the difference between class and structure?

7 5881

What is public, protected, private?

Satyam,

6 10729


Post New OOPS Questions






Un-Answered Questions { OOPS }

i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

276


which feature are not hold visual basic of oop?

636


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

411


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

1252


what type of question are asked in thoughtworks pair programming round ?

129


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.

698


what is the sylabus for priliminaries?

604


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

653


• What are the desirable attributes for memory managment?

550


i got a backdoor offer in process global,Bangalore..Can i work with it?

1251


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

848


Where You Can Use Interface in your Project

360


This program numbers the lines found in a text file. Write a program that reads text from a file and outputs each line preceded by a line number. Print the line number right-adjusted in a field of 3 spaces. Follow the line number with a colon, then one space, then the text of the line. You should get a character at a time and write code to ignore leading blanks on each line. You may assume that the lines are short enough to fit within a line on the screen. Otherwise, allow default printer or screen output behavior if the line is too long (i.e., wrap or truncate). A somewhat harder version determines the number of spaces needed in the field for the line numbers by counting lines before processing the lines of the file. This version of the program should insert a new line after the last complete word that will fit within a 72-character line.

650


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

752


i am getting an of the type can not convert int to int *. to overcome this problem what we should do?

693