What is difference between a function and a method?



What is difference between a function and a method?..

Answer / Megha Saxena

"A function is a self-contained block of code that performs a specific task. In C#, functions are not associated with objects and can exist independently. On the other hand, a method is a function that belongs to an object or class. It is used to perform actions on the object or class it is associated with."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is the difference between Decorator and Adapter pattern?

1 Answers   QuestPond,


What are strings in c#?

1 Answers  


What is token in c#?

1 Answers  


Can we inherit a private class in chsarp? how? explain(with code) ?

4 Answers   Techno Labs,


Explain namespaces in c#.

1 Answers  


How can you clean up objects holding resources from within the code?

2 Answers   L&T, Wipro,


What is the difference between list and arraylist c#?

1 Answers  


Explain static class members.

1 Answers  


Tell me something about Exceptions. What is the common exception class?

4 Answers   HCL,


coding for delegates?

3 Answers   Tech Mahindra,


What do you understand by 'access specifiers' in C#?

1 Answers   Genpact,


What is application c#?

1 Answers  


Categories