What is constructor?



What is constructor? ..

Answer / susheel kumar

A constructor is a special type of member function for
automatic initialization of an object.
when ever an object is created the constructor will be
executed automatically.
the name of constructor same as that of its class.the
constructor is declared with no return type,not even void.
constructor should be declared in the public section most
of the time.

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More JavaScript Interview Questions

Give an example of closure?

1 Answers  


How do you sort an array in javascript?

1 Answers  


What would be the result of 3+2+”7″?

1 Answers  


What is a null variable?

1 Answers  


Why are callbacks used?

1 Answers  


Can you access Cookie using javascript?

1 Answers  


How do I open a .js file?

1 Answers  


What is a closure and why are they so useful to us?

1 Answers  


java pgme for class members hours:minutes:seconds then the constructor expects milliseconds as assignment and initialize data members the members function print hh:mm:ss 90,000 milliseconds passed in constructor then the output is 00:01:30

1 Answers  


Expand BOM and explain it?

1 Answers  


What is the difference between synchronous and asynchronous JavaScrip

1 Answers  


What is object in javascript?

1 Answers  


Categories