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 ??
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...

Hey! Wanna see my flashlight? It looks like this tiny ad:
Rocket Oven Kickstarter - from the trailboss

This thread has been viewed 947 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 17, 2018 07:39:18.