函数和方法的区别? [英] Difference between function and method?

查看:39
本文介绍了函数和方法的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
方法 vs 函数 vs 过程 vs 类?

有人可以给出方法和函数之间的区别吗?

Can some one give the differences between a method and a function?

推荐答案

两者都是一样的.两者都是子程序,并且都可以返回一个值.唯一的区别可能是对课堂的依恋.方法听起来更附属于一个类,但同样,人们也习惯于调用非附属的方法.所以,在这方面他们也可以看作是一样的

Both are the same. Both are subroutines and both can return a value. Only difference may be the attachment to class. Method sounds more attached to a class but again, people use to call the non attached ones too methods. So, in that aspect too they can be seen as same

这篇关于函数和方法的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆