Q34
What will be the output of the following program code? class Rectangle public int area(int length, int width) return length*width; class Square extends Rectangle public int area(long length, long width) return (int) Math.pow(length, 2); public class Test public static void main(String args[]) Square r = new Square(); System.out.println(r.area(5 , 4));
A.
Will not compile.
B.
Will compile and run printing out 20
AnswerC.
Runtime error
D.
Will compile and run printing out 25
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board