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 ?    31 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

Finding of the 4 larger (bigger) numbers from the list like{1245,4587,2145,1163,29987,65783.....}

1 Answers   Wipro,


Which is the only operator in C++ which can be overloaded but NOT inherited?

8 Answers  


What are the two different types of polymorphism?

0 Answers  


Do you know about multiple inheritance?

1 Answers   Motorola,


What is the differances between a abstract calss and interface

5 Answers   Aviva, Symphony,






What is encapsulation with real life example?

0 Answers  


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

0 Answers  


What is overriding vs overloading?

0 Answers  


how does a main() in C++ is different from main() in C?

7 Answers  


What is difference between new and malloc?

7 Answers   emc2,


what is the difference between class and structure in C++?

9 Answers   Aspire, IBS, TCS,


what is graphics

0 Answers  


Categories