zoukankan      html  css  js  c++  java
  • 12.运算符

    1算术运算符:
    + — * % ++ --


    2关系运算符
    > >= < <= == !=


    3.布尔运算符
    &&并且 ||或者 !非 &逻辑与 |逻辑或 !逻辑非 ^逻辑异或


    4位运算符 位表示的是二进制位
    & | ~ ^ >> >>> <<
    &按位与and[真真为真,真假为假]
    | 按位 或or [假假为假,其余全为真]

    ~按位非not[真则假,假则真]

    >> 右移

    >>> 右移 ,右边空出的位以0填充

    << 左移


    5赋值类运算符
    = += -= *= %= /=

    6字符串连接运算符
    +


    7条件运算符
    ?: 即又称三步运算符

    8其他运算符
    instanceof new


    //++出现在变量的后面
    int m=10;
    int e=m ++;
    System.out.println("e="+e);//10
    System.out.println("m="+m);//11


    //++出现在变量的前面
    int f=10;
    ++f;
    System.out.println("f="+f);//11


    int c=10;
    int d=++c;//++如果出现在变量的前面,先自加1再做赋值运算
    System.out.println("d="+d);//11
    System.out.println("c="+c);//11


    int z=10;
    System.out.println(z++);//10
    System.out.println(z);//11


    int y=10;
    System.out.println(++y);//11
    System.out.println(y);//11

  • 相关阅读:
    移动端网页头部meta
    fastclick使用方法
    淘宝店铺
    Yii框架下使用redis做缓存,读写分离
    计算一个页面中的数据库查询次数和用时
    数据库优化设计
    工作中使用频率比较高的常规验证器
    框架结构
    smarty
    PDO
  • 原文地址:https://www.cnblogs.com/yyh8/p/6655185.html
Copyright © 2011-2022 走看看