开发者

How do I access "this" with a nested class, in Java?

Consider this example.

public class myclass {

public void...
public int ...

    private class my_nested_class {
          Intent i = new Intent(this, List.class);
    }

}

I would like "this" to be myclass. How can I do that? "this.super"? But that doesn't wo开发者_开发技巧rk.


It's myclass.this.

By the way, class names start with a capital letter in Java, you should rename your class MyClass.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜