Challenge: Sum of Complex Numbers

Test your understanding by solving the challenge given in this lesson.

Problem statement

Implement a class, Complex, that contains two properties, real and img, of the Double datatype. Also implement a member method, add(), to add the calling object to some other Complex object.

Get hands-on with 1200+ tech skills courses.