Просто не понимаю, почему не проходит...
package com.javarush.task.task19.task1904;
import java.io.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Scanner;
/*
И еще один адаптер
*/
//C:\Users\acer\Desktop\qwerty1.txt
public class Solution {
public static void main(String[] args) throws Exception{
/*System.out.println(new PersonScannerAdapter(new Scanner(new File(
"C:\\Users\\acer\\Desktop\\qwerty1.txt"))).read());*/
}
public static class PersonScannerAdapter implements PersonScanner{
private final Scanner fileScanner;
public PersonScannerAdapter(Scanner fileScanner) {
this.fileScanner = fileScanner;
}
//Иванов Иван Иванович 31 12 1950
//Петров Петр Петрович 31 12 1957
@Override
public Person read() throws IOException, ParseException {
String[] d = fileScanner.nextLine().split(" ");
String firstName = d[1];
String middleName = d[2];
String lastName = d[0];
DateFormat df = new SimpleDateFormat("ddMMyyyy");
Date birthDate = df.parse(d[3]+" "+ d[4]+" " + d[5]);
return new Person(firstName, middleName, lastName, birthDate);
}
@Override
public void close() throws IOException {
fileScanner.close();
}
}
}