+ 2

[SOLVED] What is the difference between Methods and Functions in C#?

The title explains everything. I’m just confused because they seems the same but I still don’t understand where is the difference. Maybe people use to call one when return a value and the other when return to nothing, but at the end they are the same concept?! Thx

16th Sep 2018, 12:03 PM
Kevin Baselice
Kevin Baselice - avatar
2 Answers
+ 3
when a function is part of class, its called a method. C# is an OOP language and doesn’t have functions that are declared outside of classes, that’s why all functions in C# are actually methods. Beside this formal difference, they are the same. C# prefers the term ‘method’ over ‘ function’
20th Sep 2018, 4:59 AM
Sithembiso Goqo
Sithembiso Goqo - avatar
+ 1
Thx so much guys!! Both answer are awesome!!
17th Sep 2018, 12:03 PM
Kevin Baselice
Kevin Baselice - avatar