Explain constructor.

Answer Posted / megha

Constructor is a method having same name as that of a
class.It is automatically invoked when an object is
created.It is used to Initialize variables of a class.It has
no return types.
3 types of constructors are:-
1)default constructor
2)parameterised constructor
3)static constructor

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain me what is an anonymous method and how is it different from a lambda expression?

730


State some of the different languages supported by .net?

729


What is the single responsibility principle?

778


Explain the difference between static page and dynamic page?

725


What are multicast delegates?

791


Can a try block have more than one catch block?

826


Can you edit data in repeater control? How?

729


Difference between abstract class and interface in .net?

782


Compare client server application with n-tier application

705


What is .net and .net framework?

821


How is .net able to support multiple languages?

786


How will you register com+ services?

1789


What is assemblies in .net?

854


Explain security measures exist for .net remoting in system.runtime.remoting?

780


What is the use com component in .net?

777