我试图在双数组中找到double的索引,它适用于字符串和整数数组但不适用于double.
double[] a = {1.1,2.2,3.3};
System.out.println(Arrays.asList(a).indexOf(1.1));
Run Code Online (Sandbox Code Playgroud)
它一直返回-1.
我有一个文本文件,里面只有一个字符“ T”,我创建了一个读取流,将正在读取的内容输出到控制台,我得到了239、187、191和84,我知道84代表“ T” ,我知道239、187、191也代表其他字符,但是我的文本文件中没有这些字符,这是怎么回事?
public class Test {
public static void main(String args[]) throws IOException {
FileInputStream in = null;
try {
in = new FileInputStream("input.txt");
int c;
while ((c = in.read()) != -1) {
System.out.println(c);
}
}finally {
if (in != null) {
in.close();
}
}
}
}
Run Code Online (Sandbox Code Playgroud)