public class SwapNum {public static void main(String[] args) {doSwapNum();}public static void doSwapNum(){//利用加减法int a = 10, b = 5;a = a + b;b = a – b;a = a – b;System.out.println("a=" + a + "\nb=" + b);}}