When is an object created and what is its lifetime?

Answers were Sorted based on User's Feedback



When is an object created and what is its lifetime?..

Answer / apurva jain

Object is created when constructor has to be invoked or
when have to access the class.Its Lifetime is throughout
the Execution of that Class.

Is This Answer Correct ?    30 Yes 8 No

When is an object created and what is its lifetime?..

Answer / nikhil

global scope,if created outside class n local scope if
created inside a class......

Is This Answer Correct ?    3 Yes 2 No

When is an object created and what is its lifetime?..

Answer / alok pandey

When the constructor called then object created thus while
the programme execute till life of object

Is This Answer Correct ?    2 Yes 2 No

When is an object created and what is its lifetime?..

Answer / yathirajulu

whenever developer is required, and the life-time is when we
assinging null or close the program(application).

Is This Answer Correct ?    2 Yes 14 No

Post New Answer

More OOPS Interview Questions

#include <iostream> using namespace std; int main() { int a = 3; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][2]; }

1 Answers  


What is difference between polymorphism and inheritance?

0 Answers  


How to Increment the value of the empid E001 for each and every employee by using the programe?

1 Answers   Accenture,


What is advantage of inheritance?

0 Answers  


suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?

3 Answers   EA Electronic Arts,






What are the four main oops concepts?

1 Answers  


Can we create object of class with private constructor?

5 Answers  


What are the 3 principles of oop?

0 Answers  


How would you stop a class from class from being derived or inherited.

18 Answers   Ness Technologies,


what is the need of abstraction? what is abstraction?what is the abstraction for stack?

8 Answers   CTS, Verizon,


What is oops concept with example?

0 Answers  


What is new keyword in oops?

0 Answers  


Categories