java - How can I access the variables of an inner class? -


class outer{   int c,    void values() {     inner.a=3;     inner.b=4;   }    void addvalues() {       **inner.a += c;** // **how can access value of a=3 values() method?**   }    class inner{       int a,b;   } } 

1) need instance of inner that

or

2) can declare inner static , make variable a static


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -