ExamVeda
Login
Home
Data Types and Variables
?

What will be the output of the following Java code?
class A 
{
    final public int calculate(int a, int b) { return 1; } 
} 
class B extends A 
{ 
    public int calculate(int a, int b) { return 2; } 
} 
 public class output 
 {
    public static void main(String args[]) 
    { 
        B object = new B(); 
        System.out.print("b is " + b.calculate(0, 1));  
    } 
}

Answer & Solution
Correct Answer: Option C
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.