• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 public class Complex {
2 
3     private double real;
4     private double imaginary;
5 
Complex(double _real, double _imaginary)6     Complex(double _real, double _imaginary) {
7         real = _real;
8         imaginary = _imaginary;
9     }
10 
Complex(String eval)11     Complex(String eval) {
12         Complex result = new Complex(0,0);
13         System.out.println(result.getReal()+","+result.getImaginary());
14     }
15 
add(Complex arg)16     public Complex add(Complex arg) {
17         return new Complex(real+arg.getReal(), imaginary+arg.getImaginary());
18     }
19 
getReal()20     public double getReal() {
21         return real;
22     }
23 
getImaginary()24     public double getImaginary() {
25         return imaginary;
26     }
27 }
28