why it can not pass?
package zh.codegym.task.task19.task1904;
import java.io.IOException;
import java.util.Scanner;
import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
/*
另一个适配器
*/
public class Solution {
public static void main(String[] args) {
}
public static class PersonScannerAdapter implements PersonScanner {
private final Scanner fileScanner;
public PersonScannerAdapter(Scanner scanner){
this.fileScanner = scanner;
}
public Person read() throws IOException{
String per1 = null;
if (fileScanner.hasNext()) {
per1 = fileScanner.next();
}
String[] tmp = per1.split(" ");
String sdate = tmp[3] + " " + tmp[4] + " " + tmp[5];
Date date = null;
try {
date = new SimpleDateFormat("MM dd yyyy").parse(sdate);
}
catch (Exception e){
}
Person newone = new Person(tmp[0], tmp[1], tmp[2], date);
return newone;
}
public void close() throws IOException{
this.fileScanner.close();
}
}
}