- 2025年05月12日
- 星期一
和平,大家好! 我正在使用 Python 3.6.3,我发现这样的构造是可能的奇怪: class TestClass(object): def __init__(self): self.arg = arg def test(): print(Hey test) 并使用: TestClass.test()Hey test 我知道
嵌套的内部类ABar和BBar可以访问主类的变量吗?例如: public class Foo { public ABar abar = new ABar(); public BBar bbar = new BBar(); public int someCounter = 0; public class ABar { public int i = 0