テキスト ファイルから整数を読み取り、配列に格納しようとしています。テキストファイルは次のとおりです。
4
-9
-5
4
8
25
10
0
-1
4
3
-2
-1
10
8
5
8
それでも、コードを実行する[I@41616dd6
と、コンソール ウィンドウが表示されます...
public static void main(String[] args) throws IOException
{
FileReader file = new FileReader("Integers.txt");
int[] integers = new int [100];
int i=0;
try {
Scanner input = new Scanner(file);
while(input.hasNext())
{
integers[i] = input.nextInt();
i++;
}
input.close();
}
catch(Exception e)
{
e.printStackTrace();
}
System.out.println(integers);
}