/**
自增和自减运算符:
++:
如果是++b,则表示先对变量b+1,再执行其他的操作;
如果是b++,则表示先执行表达式操作,再对变量自身+1
--:
用法和++相同
*/

//Test.java
public class Test16{
    public static void main(String args[]){
        int age=28;
        int a=10;
        int b=++a;
        System.out.println("b:"+b);
        System.out.println("a:"+a);
        //System.out.println(age);
        System.out.print("\"\"");
        System.out.print("\n");
    }
}

//执行结果均为11

 

相关文章:

  • 2021-09-05
  • 2021-09-23
  • 2021-10-03
  • 2022-12-23
  • 2021-10-29
  • 2021-12-17
  • 2021-08-27
猜你喜欢
  • 2021-05-18
  • 2021-08-14
  • 2022-12-23
  • 2021-05-15
  • 2021-12-06
  • 2022-12-23
相关资源
相似解决方案