java reverse

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

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

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

  • reverse() method is used to returns the value generated by reversing the order of bits in binary 2's complement denotation of the given argument.

    reverse()方法用于返回通过反转给定参数的二进制2的补码表示形式的位顺序生成的值。

  • reverse() 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.

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

  • reverse() method does not throw an exception at the time of reversing the order of bits.

    reverse()方法在反转位顺序时不会引发异常。

Syntax:

句法:

    public static int reverse(int value);

Parameter(s):

参数:

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

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

Return value:

返回值:

The return type of this method is int, it returns an integer value generated by reversing the bits order in 2's complement of the given integer value.

此方法的返回类型为int ,它返回一个整数值,该整数值是通过反转给定整数值的2的补码中的位顺序而生成的。

Example:

例:

// Java program to demonstrate the example
// of reverse(int value) method of Integer class
public class ReverseOfIntegerClass {public static void main(String[] args) {int value = 1296;
// Display value
System.out.println("value:" + value);
// It returns the string representation of the given unsigned
// integer value denoted by the argument in binary by calling
// Integer.toBinaryString(value)
System.out.println("Integer.toBinaryString(value): " + Integer.toBinaryString(value));
// It returns the value generated by reversing the
// order of the bits in the given argument value
// by calling Integer.reverse(value)
System.out.println("Integer.reverse(value): " + Integer.reverse(value));
}
}

Output

输出量

value:1296
Integer.toBinaryString(value): 10100010000
Integer.reverse(value): 144703488

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

java reverse

java reverse_Java Integer类reverse()方法与示例相关推荐

  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黑皮书课后题第5章:**5.38(十进制转八进制)编写程序,提示用户输入一个十进制整数,然后显示对应的八进制值。(不要是使用Java的Integer类的任何方法)

    **5.38(十进制转八进制)编写程序,提示用户输入一个十进制整数,然后显示对应的八进制值.(不要是使用Java的Integer类的任何方法) 题目 题目概述 破题 代码 运行示例 题目 题目概述 * ...

  4. Java.lang.Class类 isArray()方法有什么功能呢?

    转自: Java.lang.Class类 isArray()方法有什么功能呢? 下文讲述Class类中的isArray()方法的功能,如下所示: isArray()方法的功能 java.lang.Cl ...

  5. 在java中下列描述错误的是_在 JAVA 中 , 关于类的方法 , 下列描述错误的是 ()._学小易找答案...

    [多选题]价值的特性是 [简答题]输入任一字符串,统计其中数字,字母及其它字符个数 .(25分) [填空题]1.产品整体包括哪五个基本层次 2核心层次产品最基本的层次,是产品的_____ [单选题]纸 ...

  6. Java LinkedList addLast()方法与示例

    LinkedList addLast()方法 (LinkedList addLast() method) This method is available in package java.util.L ...

  7. Java LinkedList getFirst()方法与示例

    LinkedList getFirst()方法 (LinkedList getFirst() method) This method is available in package java.util ...

  8. Java LinkedList addFirst()方法与示例

    LinkedList addFirst()方法 (LinkedList addFirst() method) This method is available in package java.util ...

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

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

最新文章

  1. 报错解决:fatal error: json/json.h: No such file or directory
  2. php单文件短链接,php实现的短网址算法分享
  3. 如何撤销正在审核的苹果app?
  4. 百度开发平台提交应用后进行官方认证审核失败?
  5. mysql数据库部分操作指令
  6. 【OpenCV学习】基于轮廓寻找的视频流运动检测
  7. 计算机科学中抽象的作用,抽象释义
  8. Oracle触发器3-DDL触发器
  9. java集合 线程安全
  10. MySQL数据库MyISAM与InnoDB存储引擎的比较
  11. android 清理大师 编程,清理大师 Android v2.3.3
  12. 关于转换QQ消息中系统表情,自定义表情和截图的函数
  13. vim学习 08——搜索替换
  14. 输入输入是否为回文(如“abcba”和”123321”都是回文)。(c语言)
  15. Auto.js Pro安卓免ROOT引流脚本开发系列教程26网易公开课(4)-关注用户
  16. 从虚拟化前端Bug学习分析Kernel Dump
  17. 最新阿里云服务器和GPU服务器长期优惠活动价格表
  18. 小程序前后台切换运行机制
  19. matlab simulink 代数环问题解决
  20. macbook pro 卸载mysql_苹果mac电脑中brew的安装使用及卸载详细教程

热门文章

  1. 2018python做图形界面哪个库简单_2018年常见的python编程开发库都有哪些类型
  2. paypal创建订单后怎么获得id_5步创建Facebook商店(最新版教程)学习如何在Facebook上卖货...
  3. python图像识别代码_用Python进行简单图像识别(验证码)
  4. mac os和linux和安卓,在我的安卓手机里,安装Windows和macOS系统
  5. Linux基础(存储结构和磁盘划分)
  6. html 百分比正方形,css实现未知宽度的正方形需求
  7. Nginx(一):概念基础
  8. 创建自定义Tabs组件-01
  9. C++ 判断类是否有某变量
  10. linux常用网络命令ping和arping