Computer Science, asked by sharanya1916, 30 days ago

classA
{
final public int GetResult(int a, int b)
{
return 0;
}
class B extends A
{
public int GetResult(int aint b)
{
return 1;
}
public class Demo
{
public static void main(String arg9s[])
{
Bb=new B();
System.out.println("X=
“+b.GetResult(0,1));
}​

Answers

Answered by rishabhbaptish
2

Answer:

The output will be: X= 0

Explanation:

The GetResult in class B is not allowed as you have declared GetResult of class A as final. So it can't be overridden.

Similar questions