Source:
http://www.irixtech.com/ Given the following interface & class declarations in their respective files, what is the value of the local variable originX in the contsructor of class Draw ?
public interface IContext
{
public double originX = 0;
}
public interface IShape extends IContext
{
public double originX = 10;
}
public class Draw implements IShape
{
public Draw()
{
double originX = this.originX;
}
}
The answer is 10.0.But according to me it should be Code will not compile, "this" reference in the constructor of class Draw is ambiguous.