What will be the output of the following program.
Correct Answer : A
Execution of program starts with
main method. Three variables of type
area are declared and initialized. Then a method called
calculateArea is called passing above three variables as parameters. This moves control to the method
calculateArea. This calculates area as
area = width * breadth = 20 * 30. The control is then brought out of method. Since the variable
area is passed by value, any changes done to it will not be seen in the calling method. So,
area = 600 does not persist. Then display statement is encountered which prints local variable value
area which is still zero.