What actually wrong ?
package com.codegym.task.task19.task1904;
import java.io.IOException;
import java.util.Scanner;
import java.util.Date;
/*
Yet another adapter
*/
public class Solution {
public static void main(String[] args) {
}
public static class PersonScannerAdapter implements PersonScanner{
private Scanner fileScanner;
public PersonScannerAdapter(Scanner fileScanner) {
this.fileScanner = fileScanner;
}
public Person read() throws IOException{
Person person = null;
while (fileScanner.hasNext()) {
String s = fileScanner.nextLine();
String[] information = s.split(" ");
String firstName = information[1];
String middleName = information[0];
String lastName = information[2];
int month = Integer.parseInt(information[3]);
int day = Integer.parseInt(information[4]);
int year = Integer.parseInt(information[5]);
Date date = new Date(month , day , year);
person = new Person(middleName , lastName , firstName ,date);
}
return person;
}
public void close() throws IOException{
fileScanner.close();
}
}
}