类别“属性”的术语vs“会员” vs“变量” vs“field” [英] terminology of Class "attribute" vs "member" vs "variable" vs "field"

查看:136
本文介绍了类别“属性”的术语vs“会员” vs“变量” vs“field”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在引用存储在Class实例中的一段数据时,开发人员似乎经常互换使用这些术语。每个术语之间是否有任何技术差异,或者可以互换使用它们吗?

It seems that developers often use these terms interchangeably when referring to a piece of data stored in an instance of a Class. Is there any technical difference between each term, or is it fine to use them interchangeably?

推荐答案

根据各种答案,类属性,字段和变量相对可互换地使用,但具有因人而异的细微差别。因此,最好将它们混为一谈,而不是依赖于细微差别。

Based on the variety of answers, Class "attributes", "fields", and "variables" are used relatively interchangeably but have nuanced distinctions that vary from person to person. As such, probably best to lump them together and not rely on the nuances.

一致认为类成员包括方法和数据,因此它是独特的来自其他人。

There's consensus that a Class "member" includes methods as well as data, so it is distinct from the others.

这篇关于类别“属性”的术语vs“会员” vs“变量” vs“field”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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