什么是“已使用"?调用类的方法时的意思 [英] What does "used" mean when calling a method of a class

查看:42
本文介绍了什么是“已使用"?调用类的方法时的意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在重命名旧类之前,一切工作都很好,因为我搞砸了太多,并想通过复制所有有效的东西来重新开始.

Everything worked fine before I renamed my old class since I messed it up too much and wanted to start again by copying everything that works.

现在,当我尝试在同一类中调用方法时,我会感到奇怪的"-已使用".

Now I get this strange "- used" thingy when I try to call a method within the same class.

我认为这是因为旧类具有相同的方法和变量名称,所以我将它们全部重命名.我还重命名了新类的变量和方法,但它再次显示了这一点.

I thought it's because the old class had the same method and variable names so I renamed them all. I also renamed my new class's variables and methods but it shows this again.

我找不到正确的术语来找到答案,所以,如果这意味着我所想不到的其他事情,请赐教!谢谢!

I couldn't find the right terminology in order to find the answer, so if this means something else than what I thought, please enlighten me! Thanks!

以下是屏幕截图:

推荐答案

使用的百分比和- 百分比是一种排名系统:一些具有较高百分比的代码完成建议显示在顶部.这些首选/推荐提案的图标上标有星号.

The percentages are a ranking system: some code completion proposals with a high percentage are displayed at the top. The icons of these preferred/recommended proposals are marked with a star.

使用 是一种特殊情况:这些建议已应用于您代码中的同一变量.这有助于避免错误,例如 point.setX(1); point. setX (2); 而不是 point.setX(1);点. setY (2); .同样,如果使用需要大量计算的getter方法,则变量比多次调用更可取.看到二手作为警告,请选择当前位置的投标,而不是错误.

used instead of a percentage value are special cases: these proposals have already been applied on the same variable in your code. This helps to avoid mistakes such as point.setX(1);point.setX(2); instead of point.setX(1);point.setY(2);. Also if using a getter method that requires an extensive calculation, a variable is preferable to multiple calls. See used as a warning to choose the proposal at the current position, not as an error.

这篇关于什么是“已使用"?调用类的方法时的意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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