OOPS Interview Questions
Questions Answers Views Company eMail

What is interface? When and where is it used?

1664

What is virtual function?where and when is it used?

Sitel,

2 4646

What is debug class?what is trace class? What differences are between them? With examples.

1606

How many types of access specifier in c# and vb.net?

Infosys,

1 4547

Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers from user and swap it without using a temp variable?

NIIT,

2 3590

How can i write a code in c# to take a number from the user and then find all the prime numbers till the number entered by the user.

NIIT, TCS,

4 6057

hi all..i want to know oops concepts clearly can any1 explain??

Eureka Forbes,

1681

c++ is a pure object oriented programming or not?

Wipro,

5 5423

why we are declare the function in the abstract class even though we are declaring it in Derived class?

TCS,

1 2993

Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

HCL,

1638

which structured data type is not used in c++? 1.union 2.structure 3.string 4.boolean

HCL, Wipro,

2 5148

Write a program to reverse a string using recursive function?

TCS,

1792

Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

TCS,

4239

c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess

HCL, TCS,

1 3935

Is this job good for future? can do this job post grduate student?

1690


Post New OOPS Questions

Un-Answered Questions { OOPS }

what are the ways in which a constructors can be called?

1581


What is a class oop?

592


What is the use of oops?

619


What is coupling in oops?

595


What is abstraction in oops?

585






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

1659


What is difference between polymorphism and inheritance?

617


what are the different types of qualifier in java?

1840


What is byval and byref? What are differences between them?

1687


What is the types of inheritance?

602


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1147


can inline function declare in private part of class?

3658


write string class as your own class in java without using any built-in function

1976


What are constructors in oop?

588


When not to use object oriented programming?

569