这里没有问题........ [英] No Question Here........

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

问题描述

这里没有问题....................................

No Question Here...........................

推荐答案

这些都是编译错误.他们说您应该使用对类实例的引用,因为您使用实例成员(非静态成员),而不是类本身.您应该使用类名而不是实例变量来与静态成员一起使用-它们与任何实例都不相关,但与类本身有关.

您可以阅读我过去的回答中的一些背景说明:
什么使静态方法可访问? [
These all are compilation errors. They say that you should use the reference to the instance of the class, because you use instance members (non-static ones), not the class itself. You should have used class name instead of instance variable to work with static members — they are not related to any instance, but to the class itself.

You can read some background explanation in my past answer:
What makes static methods accessible?[^].

—SA


这篇关于这里没有问题........的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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