java - 将 int 转换为 Java 中的二进制字符串表示形式?

标签 java string binary int

在 Java 中将 int 转换为二进制字符串表示形式的最佳方法(理想情况下,最简单)是什么?

例如,假设 int 是 156。它的二进制字符串表示将是“10011100”。

最佳答案

Integer.toBinaryString(int i)

关于java - 将 int 转换为 Java 中的二进制字符串表示形式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2406432/

相关文章:

java - Guava 与 Apache Commons Hash/Equals 构建器的对比

c - 将 IP 地址从 int 更改为 string 的问题

arrays - 乐: is there a SUPER fast way to turn an array into a string without the spaces separating the elements?

java - Android - 如何用另一个字符串替换部分字符串?

c++ - 使用 std::string.c_str() 作为另一个方法的参数时的段错误

powershell - 子网和 IP 地址与尾随 0

c++ - freopen 不适用于 C 标准输入

java - Tomcat 和数据库引用

java - jOOQ - 使用 refcursor 执行 postgres 用户定义的函数

java - 高度 MapFragment 布局不起作用