?? testcomplex.java
字號:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package testcomplex;
/**
*
* @author 池光
*/
public class TestComplex{
public static void main(String[] args){
Complex complex1 = new Complex(-7,6);
Complex complex2 = new Complex(3,2);
System.out.println("(" + complex1.toString() + ")" + "+" +
"(" + complex2.toString() + ")" + "=" +
complex1.add(complex2));
System.out.println("(" + complex1.toString() + ")" + "-" +
"(" + complex2.toString() + ")" + "=" +
complex1.sub(complex2));
System.out.println("(" + complex1.toString() + ")" + "*" +
"(" + complex2.toString() + ")" + "=" +
complex1.multiply(complex2));
System.out.println("(" + complex1.toString() + ")" + "/" +
"(" + complex2.toString() + ")" + "=" +
complex1.divide(complex2));
if(complex1.compareTo(complex2) == 1)
System.out.println(complex1.toString() + ">" + complex2.toString());
else if(complex1.compareTo(complex2) == -1)
System.out.println(complex1.toString() + "<" + complex2.toString());
else
System.out.println(complex1.toString() + "=" + complex2.toString());
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -