zoukankan      html  css  js  c++  java
  • 每日总结

    今天复习的是Java中的位运算,虽然C语言和c++中都有位运算的知识,但是老师并没有讲解。

    所以在这次学Java的过程中要掌握位运算的知识。

    以int类型的6297为例,代码如下:

    1. System.out.println(Integer.toBinaryString(6297));   
    2. System.out.println(Integer.toBinaryString(-6297));   
    3. System.out.println(Integer.toBinaryString(6297>>5));   
    4. System.out.println(Integer.toBinaryString(-6297>>5));   
    5. System.out.println(Integer.toBinaryString(6297>>>5));   
    6. System.out.println(Integer.toBinaryString(-6297>>>5));   
    7. System.out.println(Integer.toBinaryString(6297<<5));   
    8. System.out.println(Integer.toBinaryString(-6297<<5));  

      运行结果:

    1100010011001
    11111111111111111110011101100111
    11000100
    11111111111111111111111100111011
    11000100
    111111111111111111100111011
    110001001100100000
    11111111111111001110110011100000

  • 相关阅读:
    POJ:2431-Expedition
    poj:3253-Fence Repair
    POJ:3617-Best Cow Line(贪心)
    IOS各种传值方式
    imageDownloader
    Android放大镜的实现
    Delphi 串口通信(1)
    UVA 10131
    Skew Join与Left Semi Join相关
    Android动画 fillAfter和fillBefore
  • 原文地址:https://www.cnblogs.com/lxywsx/p/14173798.html
Copyright © 2011-2022 走看看