“对象"与“对象变量"在爪哇? [英] "Object" vs "Object Variable" in Java?

查看:49
本文介绍了“对象"与“对象变量"在爪哇?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在自学 Java,我书中的一个复习练习要求区分对象"和对象变量".

I am teaching myself Java, and one of the review exercises in my book asks for the difference between an "object" and an "object variable."

我知道对象是什么(类的特定实例),但我似乎无法在本书(无答案部分)或互联网上的任何地方找到术语对象变量".

I know what an object is (a specific instance of a class), but I can't seem to find the term "object variable" anywhere in the book (no answers section) or on the internet.

有人知道这个词的意思吗?

Does anyone know the meaning of this term?

推荐答案

实例变量"的同义词:

class A {
    static int m;  // <-- class variable
    int n;         // <-- instance variable
    ...
}

显然,这个术语并不常用,最好只使用实例变量"来避免任何潜在的歧义.

Evidently, this term is not so commonly used, and it would better to avoid any potential ambiguities by just sticking with "instance variable".

这篇关于“对象"与“对象变量"在爪哇?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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