**Java help-Main method not found in class**

` public class Complex{ double x, y; Complex(double a, double b){ x = a; y = b; } Complex(double a){ x = a; y = 0; } Complex(){ x = 0; y = 0; } double getRealPart(){ return x; } double getImaginaryPart(){ return y; } Complex add(Complex Q){ Complex addResult = new Complex(x + Q.x, y + Q.y); return addResult; } Complex subtract(Complex Q){ Complex subResult = new Complex(x - Q.x, y - Q.y); return subResult; } Complex multiply(Complex Q){ Complex mulResult = new Complex(x * Q.x - y * Q.y, y * Q.x + x * Q.y); return mulResult; } Complex divide(Complex Q){ Complex divResult = new Complex((x * Q.x + y * Q.y) / (Q.x * Q.x + Q.y * Q.y), (y * Q.x - x * Q.y) / (Q.x * Q.x + Q.y * Q.y)); return divResult; } double abs(){ return Math.sqrt(x * x + y * y); } public String toString(){ if(y == 0) return "" + x; else return "(" + x + " + " + y + "i)"; } } `

Submitted July 12, 2017 at 09:20PM by QxUAS_op3-3

via reddit http://ift.tt/2t5FmG8

### Like this:

Like Loading...

*Related*