English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Take a look at this... :
import java.awt.*;
import java.awt.event.*;
public class ComplexNumbers
{
public double a;

public double b;


public void setNumbers()

{


EasyReader console = new EasyReader();
System.out.print("Considering the formula ' a+ bi '" +'\n');
System.out.print("Enter a: ");
a = console.readInt();
System.out.print("Enter b: ");
b = console.readInt();

}

Complex h = new Complex (a,b);

public void Complex (double a, double b)
{


}

public void Complex (double a)
{

}
}

When compiled it returns the error:
cannot find symbol : constructor Complex(double,double)
Help!?!??!

2006-11-05 14:30:03 · 5 answers · asked by ichr123 2 in Computers & Internet Programming & Design

Eh. nope Jeison Iyasu, that's wrong, you need all constructors (the complex(double a, double b) and complex(double a) in a class... in fact, all code in a document needs to be in a class.. :D.

I'm actually trying to run a program for my Java class that takes two numbers (double) a and b
where a and b are in the complex equation:
a+bi
*sigh* fun fun...

2006-11-05 14:42:36 · update #1

bump diddley diddley, bump back up the list!

2006-11-05 14:49:09 · update #2

GEE THANKS KC I REALLY NEED A USELESS ANSWER.

2006-11-05 14:49:56 · update #3

If anyone needs more details just post, and I'll answer any questions... i really need help...

2006-11-05 14:57:36 · update #4

Um... even if you can point me to a website... i might just give you best answer if it helps me...

2006-11-05 15:19:32 · update #5

5 answers

I think there may be a couple problems with your code, but I'll help you with one. You have created a class named ComplexNumbers. Towards the bottom of your code, you have a couple of constructor methods named Complex. Now, if those are the constructor methods for ComplexNumbers, they need to be named ComplexNumbers (the same as the class). If they are really constructors for a class named Complex, then you need to put them in a class named Complex. The bottom line is the constructor methods must have EXACTLY the same name as the class they are in...

2006-11-05 15:42:57 · answer #1 · answered by heartsensei 4 · 0 0

fedest.com, questions and answers