what is costructor?



what is costructor?..

Answer / dipraj shahane

Constructor is special member function of class which having
same name as Class name and no return type. Main function of
Constructor is to initialize (give default values to member
variable of class object) object. Constructor gets invoke
when you create new object by following syntax.

ClassName objectName = new ClassName();

Is This Answer Correct ?    22 Yes 0 No

Post New Answer

More OOPS Interview Questions

to remove the repeated numbers from the given . i.e.., if the input is 12233 output should of 123

2 Answers  


What is multilevel inheritance explain with example?

0 Answers  


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

1 Answers   Accenture,


create a c++ program that will accepts 9 inputs using 3 by 3 array.

1 Answers  


What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 2) 17 3) 16.5

16 Answers   TCS,






What is ambiguity in c++

4 Answers   Accenture, Mphasis,


What type of loop is a for loop?

0 Answers  


Write on signed and unsigned integers and give three (3) examples each

1 Answers  


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

0 Answers   CAT,


Why do we use class in oops?

0 Answers  


Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.

0 Answers  


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

1 Answers   TCS,


Categories