java中变量的几种名称fileds,parameters,arguments

java中的变量有好几种类型(此处的类型不是指type,基础类型或者某个java对象),可以根据变量的声明位置和变量的出现时间分类,以下英文摘自oracle的官方JDK tutorial。使用单词可以更清晰的理解变量。

There are several kinds of variables:

Member variables in a class—these are called fields.
Variables in a method or block of code—these are called local variables.
Variables in method declarations—these are called parameters.

Note: Parameters refers to the list of variables in a method declaration. Arguments are the actual values that are passed in when the method is invoked. When you invoke a method, the arguments used must match the declaration’s parameters in type and order.

java中变量(variables)按照其声明的位置可以分为以下几种:
1、fields. 字段。声明在类里面。
2、parameters 参数。声明在方法或者构造器的()里。
3、local variables 本地变量。 声明在方法体里或者构造器里。
以上都是静态变量的名称。

arguments:(英文解释中不是argument的复数)
是java在runtime的时候,JVM调用方法或者构造器时传入的参数。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值