what is constructor in a class, how it is work, how it is call?

Answer Posted / sei thu htun

Constructors are functions in a class that are automatically
called when you create a new instance of a class with new. A
function becomes a constructor, when it has the same name as
the class. If a class has no constructor, the constructor of
the base class is being called, if it exists.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is default session time in php?

721


What is a php trait?

699


What are the advantages of indexes?

705


How do http requests work?

716


What is regular expression in php?

753


Tell me what is the difference between the functions strstr() and stristr()?

767


Tell me can you extend a final defined class?

731


What is use of isset function in php?

794


Is php a low level language?

727


Explain NULL?

794


Is php case sensitive?

706


What is the difference between exception::getmessage and exception::getline?

749


What is return in php function?

756


What is the difference between characters 34 and x34?

835


Why is php so popular?

705