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

write a program that input four digit number and find how many 7 that number contains

4 Answers  


Give the output of the following program main() {char *p='a'; int *i=100/*p; } what will be the value of *i= 1

6 Answers   Sun Microsystems,


What is 2*2?

7 Answers  


wap in c++ which accept a integer array and its size as argument and replaces element having even values with its half and element having odd values with twice its value

1 Answers  


What is the disadvantage of templates ?

2 Answers   NSN, Symphony,






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 a template?

2 Answers   Amazon, BITS, IBS, Wipro,


Describe the elements of Microsoft Word screen. Write down steps for creating, saving, retrieving, editing and printing a document.

2 Answers  


what's the difference between function overloading and function overiding?

5 Answers  


What is stl language?

0 Answers  


What is a list in c++ stl?

0 Answers  


Categories