为什么在Java中将函数称为方法? [英] Why functions are called methods in java?

查看:124
本文介绍了为什么在Java中将函数称为方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么函数在Java中被称为方法.我不是要问两者之间的区别.为什么Java社区选择将它们命名为方法.这个决定背后是否有任何具体的原因,或者仅仅是一个名字? 当我想到字面意义时,我认为功能与某些机器的内部工作有关.方法是实现目标(数学解决方案)的一种方法,也可能是实现对象的一种方法. 是从哪里来的,还是我只是错过了真实的照片?

Why functions are called methods in java. I am not asking the difference between the two. Why Java community choose to name them methods. Is there any concrete reason behind this decision or it's just a name? When i think of literal meaning as far as i could think function is related to internal working of some machine. Method is a way of working to achieve a goal(mathematical solution) or may be method is a way of implementing an Object. Is that where it came from or i just missed the real picture?

推荐答案

它不是Java语言,而是 OOP名称.

It's not in Java, it's an OOP name.

排序上,它定义了对象实例的一部分行为,而不是常规操作.

In sort, it defines part of the behavior of an instance of an object, not a general operation.

这篇关于为什么在Java中将函数称为方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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