Close sidebar

What will be the output of the program? class A { final public int GetResult(int a, int b) { return 0; } } class B extends A { public int GetResult(int a, int b) {return 1; } } public

A. An exception is thrown at runtime. B. Compilation fails. C. x = 1 D. x = 0

  • Deepshikha
  • 9240 Views
  • 4 Answers
4 Answers
  • An exception will be thrown at compile time because , the method once declared final cannot be overriden .


  • compilation fails,because A class method is final which we donot overridden this method


  • Ans-Abr / 


Practice Mock Test
java programming test