Problem

Suppose you want to add a constructor to Complex that takes a double value as its argument...

Suppose you want to add a constructor to Complex that takes a double value as its argument and creates a Complex number with that value as the real part (and no imaginary part). You write the following code:

public void Complex(double real){   re = real;   im = 0.0;}

But then the statement Complex c = new Complex (1.0) does not compile. Why?

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 3.2