M

Mr. Dubey • 52.30K Points
Coach

Q. Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?

(A) add (), str ()
(B) str (), add ()
(C) sum (), str ()
(D) str (), sum ()
Correct : Option (A)

Explanation:
 the function     add    () is called first since it is within the bracket. the function     str    () is then called on the object that we received after adding a and b.

Share

Discusssion

Login to discuss.

Be the first to start discuss.