constructor - How do you create a complex variable in java? -


i'm using eclipse , messing around complex numbers. not sure how this. know how integer , double not complex type. found said

complex c= new complex(1.0.3.0); // 1+3i 

but doesnt quite work out. gives error says constructor undefined?

do have complex.class file in same folder other code? grabbed complex class here, created complex.class file javac complex.java , running following code (filenames example.java , example.class) not problem:

class example {     public static void main(string [] args) {         complex = new complex(1,2);     } } 

Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -