转换一个int在Java二进制字符串重新presentation? [英] Converting an int to a binary string representation in Java?

查看:185
本文介绍了转换一个int在Java二进制字符串重新presentation?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是最好的方式(理想情况下,最简单的)一个int转换为Java中的二进制串重新presentation?

例如,说int是156的二进制字符串再此presentation将是10011100。


解决方案

  Integer.toBinaryString(int i)以

What would be the best way (ideally, simplest) to convert an int to a binary string representation in Java?

For example, say the int is 156. The binary string representation of this would be "10011100".

解决方案

Integer.toBinaryString(int i)

这篇关于转换一个int在Java二进制字符串重新presentation?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆