带下划线的变量 [英] Variables with underline

查看:125
本文介绍了带下划线的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Android Studio的某些变量中有下划线(在本例中为'position'变量).我认为这不是错误,因为应用程序可以完美运行,并且编译器可以通过所有操作. 我想知道这是什么意思?

I'm getting an underline in some variables on Android Studio (in this case on the 'position' variable). I think it's not an error because the application runs perfectly and the compiler passes everything ok. I'm wondering what does that mean?

推荐答案

我相信带下划线的变量代表常量(final或

I believe the underlined variables are representative of constants (final or effectively final), because in my experience I only see this decoration when I declare a final object for use inside an anonymous class. I can't seem to find it in the documentation, though.

这篇关于带下划线的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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