方法和功能之间的区别? [英] Difference between Method and Function?
问题描述
我是c#的初学者,并且对学习c#有浓厚的兴趣,但是我很困惑.当我问一个函数和方法之间有什么区别时,他对我说没有区别,它们都具有相同的功能.
现在我很困惑,想从优秀的开发人员那里了解什么方法和函数?
I am a beginner in c# and have a keen interest to learn c#, but I am confused. When I asked some one what the difference is between Function and method, he said to me that there is no difference, that they both have the same functionality.
Now I am quite confused and want to know from good developers what methods and functions are?
它们都一样吗?如果没有,那我该如何初始化每个人?
Are they both the same? If not, then how do I initialize each one??
这样可以正确初始化函数吗?
Is this way to initialize a function correct?
public void UpdateLeaveStatus(EmployeeLeave objUpdateLeaveStatus)
当我是新人时,请提供适当的帮助.
Please provide proper help as I am new.
推荐答案
两者都是相同的,没有区别,只是C#中相同事物的术语不同.
Both are same, there is no difference its just a different term for the same thing in C#.
方法:
在面向对象的编程中,方法是子例程(或过程)或功能).
In object-oriented programming, a method is a subroutine (or procedure or function) associated with a class.
对于面向对象的编程,使用的是方法"一词,而不是函数.
With respect to Object Oriented programming the term "Method" is used, not functions.
这篇关于方法和功能之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!