Код: Выделить всё
File inFile = new File("PhoneRecords.txt");
String path = inFile.getAbsolutePath();
try {
System.setIn(new FileInputStream(path));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
Scanner sc = new Scanner(System.in);
Код: Выделить всё
public static PhoneCall readNextPhoneCall(Scanner sc){
return new PhoneCall (sc.nextDouble(), sc.nextInt());
}
Подробнее здесь: https://stackoverflow.com/questions/262 ... th-eclipse
Мобильная версия