What is the output of the given program code?
public class ScopeTest
{
public static void main(String[] args)
{
ScopeTest sc, scA, scB;
sc = new ScopeTest();
scA = new ScopeTestA();
scB = new ScopeTestB();
System.out.println("Hash is : " + sc.getHash() + ", " + scA.getHash() + ", " + scB.getHash());
}
public int getHash()
{
return 111111;
}
}
class ScopeTestA extends ScopeTest
{
public long getHash()
{
return 44444444;
}
}
class ScopeTestB extends ScopeTest
{
public long getHash()
{
return 999999999;
}
}
Reveal answer
Fill a bubble to check yourself