[Logo]
Forums Register Login
Interface implementation issue



i have to print f1 interface variable


Your code will not compile because reference to i is ambiguous, both variable i in f1 and variable i in f2 match
so you have to use f1.i
thanks a lot
This should work.

Hi all,

variables declared inside a interface are implicitly public ,static and final,
So, we can refer to the desired variable by using qualified name with interface type..

Can some one explain how to access the super class instance variable of same name....



Hoe to access the f3 version of variable i ??
@Hareendra
You can start new thread and ask question about super class and sub class issue because subject line of thread is interface implementation issue.
would the i not be overridden if one interface extends another?
Overriding happens with instance method
See OverridingVsHiding
Hi Hareendra,

You can access the value of i of f3 as mentioned below -

Thank you Salil...
Also:

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Oct 19, 2017 02:12:09.