What is Constructor

Answers were Sorted based on User's Feedback



What is Constructor..

Answer / biswajit rout

Constructor is a special type of member function which
never returns any value.It is mainlly used for
initilazation of data member(s).It can only invoked by the
creation of the object of the respective class.constructor
can very well use AccessSpecifier.
constructor can very well overloaded but it can not be
overridden.

Is This Answer Correct ?    1 Yes 0 No

What is Constructor..

Answer / dipankar gain

constructor is just like a method(a function in C/C++) which
is called before the object of the class is created.
Generally you dont need to give the constructor in the class
definition but if you want to do something like initializing
variables, starting a connection, connect to the database,
then you should use the constructors.
If you dont include the constructor in your class, then the
java compiler puts it for you, its called the default
constructor.

Is This Answer Correct ?    0 Yes 0 No

What is Constructor..

Answer / ada

Constructor creates an object and initializes it. It also
creates vtable for virtual functions. It's different from
other methods in a class.

Is This Answer Correct ?    17 Yes 22 No

What is Constructor..

Answer / raj

contructor is construct which is construct
something................

Is This Answer Correct ?    6 Yes 16 No

Post New Answer

More STL Interview Questions

Diffrernce Between Overloading and Overriding?

2 Answers   Wipro,


please visit this site you'll find my question this is my homework please answer it if you can http://easyscience.org/ib/lofiversion/index.php/t36168.html

0 Answers  


When did c++ add stl?

0 Answers  


Define stl.

0 Answers  


Is there any error below, its a code to delete all entires from a map #include <map> #include iostream.h int main() { int i =0; map <int, char> TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map<int, char> :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }

0 Answers  






write a program that input four digit no and finds it is palindrome or not

2 Answers  


What is a list in c++ stl?

0 Answers  


What is 2*2?

7 Answers  


What is stl stand for?

0 Answers  


Question 1)Read the data from one file and remove all the duplicated words and generate an output file containg only using words.Program should also print number of occurance of each words on standard output.(Program must be use STL and iostream object). Question 2)Write a program to convert the lower case contents of file to upper case using STL. Question 3)What is the output of this problem. int i=12; int &r =i; r+r/4; int +p =&r; int *p = &r; P+=r; return 1; Answer :a)12 b)17 c) 30 d)24 E)15 Question 4) #include #include #include void main() { char srcstr[30],desstr[30]; int i,len; clrscr(); cout<<"\nenter the string\n"; cin>>srcstr; len=strlen(srcstr); for(i=0;srcstr[i]!='\0';i++) { desstr[--len]=srcstr[i]; } desstr[i]='\0'; cout<<"\nreversed string is\n"; for(i=0;desstr[i]!='\0';i++) { cout< } getch(); } Answer : A) string output b)tuptuo gnirts c) string d)output Question 5) Class Test { static const Tk=LEN; int q; public: foo(intx =LEN):q(x){}; TGet Q() const { return q:} void call test Foo<long :9> foo(10); std::const<< foo.Getq(); Answer: 7,8,9,10,11 question 6) class A { int a; char b; }; class B:public A { char b; int a; }; What is the size? Answer a)5 bytes for class A and 5 bytes class B b)4 bytes for class A and 8 bytes class B. c).... d)....

2 Answers   Bally Technologies,


what is template and type convertion

0 Answers   TATA,


Find the error in the following program struct point {struct point *next; int data; } x; main() {int...data; } x; main() {int i; for(x=p;x!=0;) x=x->next,x++; freelist(x); } freelist(x) {free(x); return }

1 Answers   Sun Microsystems,


Categories