Hi,
This is the code I got from a mock,
interface Ques01 {
String str = " Ques01 " ;
}
class Ques02 {
String str = " Ques03 " ;
};
class Ques extends Ques02 implements Ques01 {
// String str = "Ques";
public static void main ( String args [ ] ) {
System . out . println ( str ) ;
}
}
We have 2 variables named str , 1 is a staic variable and the other instance variable.
I dont see the reference as ambiguous, coz str in print statement should refer to interface
static variable, then why does it gives this error ?
reference to str is ambiguous, both variable str in Ques02 and
variable str in Ques01 match
System . out . println ( str ) ;
^
Help please !
Thanks in advance,
Regards,
R.Aashu