What is difference between function and method in c#?



What is difference between function and method in c#?..

Answer / Mujeeb Akhtar

In C#, a function is a block of code that performs a specific task. A method is a member of a class that can access its fields, properties, and other methods. All methods are functions, but not all functions are methods.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

Can we inherit private members of class in c#?

1 Answers  


Can fields inside a class be virtual?

1 Answers  


Do vs while c#?

1 Answers  


What does namespace mean?

1 Answers  


What do you mean by hashtable c#?

1 Answers  


What is serialization and deserialization in c# with example?

1 Answers  


How to transpose rows into columns and columns into rows in a multi-dimensional array?

4 Answers   Microsoft,


How is the syntax written to inherit from a class in C#?Give an example ?

1 Answers   Siebel,


What are the steps to make an assembly to public?

1 Answers  


What is disco?

1 Answers  


What is Private Constructor? and it’s use? Can you create instance of a class which has Private Constructor?

1 Answers  


hi, I am a begineer to c sharp. I have written a code for finding out prime numbers. Can anyone identify what are the flaws in my code. Kindly donot complex the code or present logic because i am new to c sharp and just started learning programming language.Thanks in advance. class Program { static void Main(string[] args) { int a,b=1; a = int.Parse(Console.ReadLine()); c= int.Parse(Console.ReadLine()); if (a % b == 0 && a % 2 != 0 && a % a == 0) Console.WriteLine(a); else if (a % b == 0 && a % 2 == 0) Console.WriteLine(a%2); Console.WriteLine("Number is not PRIME"); Console.ReadLine(); } } }

2 Answers  


Categories