Код: Выделить всё
import java.io. File;
import java.io. FileNotFoundException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.function.BinaryOperator;
import java.util.*;
public class Read_int_array_a
{
private final static String FILE_NAME = "D:/sumit/sample-project/final/file3.txt";
private final static String DELIMITER = ", ";
public static void main(String[] args)
{
File inputFile = new File(FILE_NAME);
ArrayList numbers = new ArrayList();
try
{
Scanner scanner = new Scanner(inputFile);
scanner.useDelimiter(DELIMITER);
while(scanner.hasNext())
{
String value = scanner.next();
Integer num = Integer.parseInt(value);
System.out.print(num);
numbers.add(num);
}
scanner.close();
System.out.println(" ");
int[] jcdIntArray = new int[numbers.size()];
int myInt = 0;
for(Integer jcdInt : numbers) {
jcdIntArray[myInt++] = jcdInt;
}
for(Integer myInteger : jcdIntArray) {
char ch = (char)myInteger;
System.out.print(ch);
}
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
}
}
70, 73, 78, 65, 78, 67, 73, 65, 76, 32, 80, 82, 79, 68, 85, 67, 84, 83, 32, 68, 73, 83, 84, 82, 73, 66, 85, 84, 73, 79, 78, 32, 76, 73, 77, 73, 84, 69, 68
Подробнее здесь: https://stackoverflow.com/questions/786 ... ready-stor