What is the difference between method and constructor in c#?



What is the difference between method and constructor in c#?..

Answer / Rachit Vanslas

In C#, a method is a function that performs a specific task, can have a return value, and is called by its name along with arguments in parentheses. A constructor is a special method used to initialize an object of a class when it's created. The main difference lies in their purpose: a method is for performing operations while a constructor initializes the object.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

List down the different ide’s provided by microsoft for c# development.

1 Answers  


How?s method overriding different from overloading?

3 Answers  


How can I process command-line arguments?

1 Answers  


Can you change the value of a variable while debugging a C# application?

2 Answers  


What is expression c#?

1 Answers  


What are Types of assemblies that can be created in dotnet

1 Answers  


What are collection classes?

1 Answers  


What is the difference between static class and sealed class in c#?

1 Answers  


Suppose in a scenario if we want to display information only until 4.00 p.m and after that means after 4.00 p.m if any one tries to access the information it should give error mesage. Then how will you write a delegate for this ? Give coding.

1 Answers   HP, nTech Solutions, Primetech Software, PS,


Is c# static or dynamic?

1 Answers  


Can you create enumerated data types in C# ?

1 Answers  


List down the fundamental oop concepts?

1 Answers  


Categories