What will be the output of the following program?
public class Test
{
public static void main (String args[ ])
{
B o = new A ();
System.out.println (o.content ());
}
public String content () throws Exception
{
throw new Exception (''This is an exception on this.content ()'');
}
private static class B
{
public String content ()
{
return ''B'';
}
}
private static class A extends B
{
public String content ()
{
return ''A'';
}
}
}
Correct Answer: The code will compile and on running, it will print ''A''
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Java MCQ Questions