gpt4 book ai didi

java - 如何使用 Java 将十六进制的 String 数组转换为 int 数组?

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:59:16 25 4
gpt4 key购买 nike

<分区>

我有一个像下面这样的类

public class EXOR{

public static void conv(){
String [] Parray={"243f6a88","85a308d3","13198a2e","03707344","a4093822","299f31d0","082efa98",
"ec4e6c89","452821e6", "38d01377", "be5466cf","34e90c6c","c0ac29b7","c97c50dd","3f84d5b5","b5470917","9216d5d9","8979fb1b"};

String binAddr[]=new String[18];
for (int i=0;i<18;i++)
{
int x[]=new int[18];
binAddr[i]= Integer.toBinaryString(Integer.parseInt(Parray[i],16));
System.out.println("binernya : " +binAddr[i]);
}

}

public static void main(String[] args){
new EXOR().conv();

}
}

我想将该数组转换为二进制数组格式。我想得到如下输出例如

00100100001111110110101010001000
10000111101000110000100011010011
................................

如何解决这个问题?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com