След

System.out.println("ddddd" + resultat);

напиши

scan.close();