rotateleft

整数类rotateLeft()方法 (Integer class rotateLeft() method)

  • rotateLeft() method is available in java.lang package.

    rotationLeft()方法在java.lang包中可用。

  • rotateLeft() method is used to returns the value generated by rotating the binary 2's complement denotation of the given argument (value) left by the given number of bits.

    rotationLeft()方法用于返回通过旋转给定位数剩下的给定参数(值)的二进制2的补码表示而生成的值。

  • rotateLeft() method is a static method, it is accessible with the class name too and if we try to access the method with the class object then also we will not get an error.

    rotationLeft()方法是一个静态方法,也可以使用类名进行访问,如果我们尝试使用类对象访问该方法,那么也不会收到错误。

  • rotateLeft() method does not throw an exception at the time of rotating or shifting of bits.

    旋转或移位位时, rotateLeft()方法不会引发异常。

Syntax:

句法:

    public static int rotateLeft(int value, int rotation);

Parameter(s):

参数:

  • int value – represents the integer value to be parsed.

    int value –表示要解析的整数值。

  • int rotation – represents the distance of rotation.

    int rotation –表示旋转距离。

Return value:

返回值:

The return type of this method is int, it returns an integer value generated by rotating the 2's complement binary of the given integer value left by the given number of bits.

此方法的返回类型为int ,它返回一个整数值,该整数值是通过将给定整数值的2的补码二进制数旋转给定位数而生成的。

Example:

例:

// Java program to demonstrate the example
// of rotateLeft(int value, int rotation) method of Integer class
public class RotateLeftOfIntegerClass {public static void main(String[] args) {int value = 3;
int rotation = 1;
// Iterates till the value of rotation reaches
while (rotation < 4) {// It return the value generated by rotating the
// 2's //complement of the given argument (value) left
// by given number of bits
value = Integer.rotateLeft(value, 3);
System.out.println("value: " + value);
++rotation;
}
}
}

Output

输出量

value: 24
value: 192
value: 1536

翻译自: https://www.includehelp.com/java/integer-class-rotateleft-method-with-example.aspx

rotateleft

rotateleft_Java Integer类rotateLeft()方法与示例相关推荐

  1. java中intvalue方法作用_Java Integer类intValue()方法及示例

    整数类intValue()方法intValue()方法在java.lang包中可用. intValue()方法用于返回此Integer对象表示的值,该值转换为int类型(通过强制转换). intVal ...

  2. Java中Integer类的方法

    java.lang 类 Integer java.lang.Object java.lang.Number java.lang.Integer 全部已实现的接口: Serializable, Comp ...

  3. java getmethod类_Java Class类 getMethod()方法及示例

    Class类getMethod()方法getMethod()方法在java.lang包中可用. getMethod()方法用于返回Method对象,这些对象指示该类的给定公共方法或由此Class对象表 ...

  4. java的isArray_Java Class类 isArray()方法及示例

    Class类isArray()方法isArray()方法在java.lang包中可用. isArray()方法用于检查此类是否表示数组类. isArray()方法是一个非静态方法,只能通过类对象访问, ...

  5. java super.getclass_Java Class 类 getSuperClass()方法及示例

    Class类getSuperClass()方法getSuperClass()方法在java.lang包中可用. getSuperClass()方法用于返回Class,该Class表示此Class表示的 ...

  6. java long short_Java Long类shortValue()方法与示例

    Long类shortValue()方法shortValue()方法在java.lang包中可用. shortValue()方法用于返回由此Long对象表示的值,该对象转换为short类型(通过强制转换 ...

  7. java annotation class,Java Class类 isAnnotation()方法及示例

    Class类isAnnotation()方法isAnnotation()方法在java.lang包中可用. isAnnotation()方法用于检查此Class对象是否表示注释类型. isAnnota ...

  8. java parsefloat 误差_Java Float类parseFloat()方法与示例

    Float类parseFloat()方法parseFloat()方法在java.lang包中可用. parseFloat()方法用于返回与给定String表示形式相对应的float值,换句话说,我们可 ...

  9. java compareto long_Java Long类compareTo()方法与示例

    Long类compareTo()方法compareTo()方法在java.lang包中可用. compareTo()方法用于在数学上检查该Long对象与给定Long对象的相等性或不相等性,换句话说,可 ...

最新文章

  1. mysql中如何将一个表中的部分记录合并,MySQL数据库将多条记录的单个字段合并成一条记录_MySQL...
  2. 导入训练好的决策树文件_决策树在sklearn中的实现
  3. java 广义表_数据结构:广义表的实现(Java)
  4. 系统解读:权限设计指南
  5. Abp vNext 后台作业hangfire
  6. controller接收json数据_SpringMVC实现多种数据类型绑定
  7. 网络电话全民亲情祝福 中秋团圆新方式
  8. Apache/Tomcat/JBOSS/Neginx/lighttpd/Jetty 的区别
  9. 2011年11月27日学习内容总结
  10. ubuntu 1404部署tomcat7
  11. 最优化学习---从解方程到最优化1
  12. 图论算法——有向图的邻接链表实现
  13. cenos7上部署python3环境以及mysqlconnector2.1.5
  14. TCP异常终止(RESET报文)
  15. Web 探索之旅 | 第二部分第四课:数据库
  16. php导出Excel表格
  17. mysql stmt fetch,mysql_stmt_fetch 奇怪的问题..
  18. 面试最后问你期望薪酬_我不能问你的薪水历史吗? 谢谢!
  19. autojs之QQ 群发消息(挖坑)
  20. mysql latch和缓存关系_latch:cachebufferschains等待事件导致的latch争用的原理原因与...

热门文章

  1. python3.0下载用什么浏览器_无法让Python下载网页源代码:“不支持浏览器版本”...
  2. maya导出fbx没动画_Maya学习方法总结
  3. 树莓派摄像头_Arducam 8MP重磅来袭,为树莓派4B构建完全同步的双摄像头方案~
  4. mysql 横向扩展 中间件_mysql-proxy数据库中间件架构 | 架构师之路
  5. 创造型模式——抽象工厂模式
  6. IOS之Foundation之探究学习Swift实用基础整理一
  7. HDFS DataNode 设计实现解析
  8. 25 个精美的后台管理界面模板和布局
  9. 更改临时文件夹的路径
  10. Java线程的使用及共享协作