Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ComplexNumber <T extends Number,U extends Number> implements Comparable<ComplexNumber> {
- private T real;
- private U imaginary;
- public ComplexNumber(T real, U imaginary) {
- super();
- this.real = real;
- this.imaginary = imaginary;
- }
- public T getR() {
- return real;
- }
- public U getI() {
- return imaginary;
- }
- public double modul(){
- return Math.sqrt(Math.pow(real.doubleValue(),2)+ Math.pow(imaginary.doubleValue(), 2));
- }
- public int compareTo(ComplexNumber<?, ?> o){
- //HELP HERE
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement