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.
精彩评论