Correct Answer : B
Initially, the main
method of the program is called and the variables m,n,x,y
are initialized to the respective values. The variable b
is of the type boolean
which is initialised to the value evaluated in the expression m < n
. So, b
is initialised to TRUE
.
Now, the method operate
is called and the values are printed. As we can observe the parameters passed are x
, y
, m
, n
, b
, so the value of d1
will be x
, d2
will be y
, d3
will be m
, d4
will be n
and d5
will be b
. When the ternary statement is as d5
has the value TRUE
, the first part d1 + d2
is executed and the answer 21.0 + 98.0 = 119.0
is typecasted to 119
and is stored in o
which is then printed.
Hence the answer is B.