Explain constructor?

Answer Posted / pragnyan

Constructor is a method having the same name as the class
name.It is automatically invoked when instance of the class
is created.It is used to initialize the members.Constructos
canot have any return type not even void.constructors can
be overloaded.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is console writeline in c#?

462


Can we customize the serialization process?

518


What is tryparse?

511


What is difference between il and dll ?

522


Is int an object in c#?

506






i want o/p 011242110 in c# code.

1621


Can I define a type that is an alias of another type (like typedef in c++)?

530


What happens during the process of boxing?

591


What is difference between static and readonly in c#?

440


How will you allow a class to be inherited, but prevent the method from being over-ridden?

519


What are nested classes in c#?

539


What are jump statements in c#?

497


How do you sort an array in c#?

485


How long does it take to get a loop recorder put in?

458


Is it possible to nest cfml conditional tags?

532