java - If outer class(enclosing class) and inner class have data member with same names then how can we differentiate them -


if have class following have data members same names in inner , outer class, how can differentiate them? if want calculate sum of inner 2 int a+b, outersum?

public class outerclass {     int a;     int b;     class innerclass{         int a;         int b;         int innersum = a+b;         int outersum = ?;     } } 

int outersum = outerclass.this.a + outerclass.this.b; 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -