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
- 9240 Views
- 4 Answers
4 Answers
Practice Mock Test
java programming test
An exception will be thrown at compile time because , the method once declared final cannot be overriden .