一眼看我也没看出哪里错了,没办法就拿代码运行了,很明显的提示是你定义的是char类型 你写的是字符串 只要把char[] arr={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"}; 改成char[] arr={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; char是单引号 String字符串是双引号
下面是提示
demo.java:4: 错误: 不兼容的类型
{ char[] arr={"0","1","2","3","4","5","6","7","8","9","A","B","C"
,"D","E","F"};
^
需要: char
找到: String
16 个错误 |