read a line from a file

Hello! I'm learning a little bit how to programme in java and I have a work to do. I have to read a file with a lot of lines where each line has 3 numbers: 2 doubles and 1 int (4.5 3.5 7). I'm trying to do like this but it doesn't work... the line in green is the one that it considers as wrong. Does anybody can help me?

Scanner amostra=new Scanner(new File ("file"));
String linha =amostra.nextLine();
Scanner leitorLinha=new Scanner (linha);
leitorLinha.delimiter();
System.out.println(leitorLinha.nextDouble());
System.out.println(leitorLinha.nextDouble());
System.out.println(leitorLinha.nextInt());
amostra.close();
thanks a lot[code=java]
Hello! I'm learning a little bit how to programme in java and I have a work to do. I have to read a file with a lot of lines where each line has 3 numbers: 2 doubles and 1 int (4.5 3.5 7). I'm trying to do like this but it doesn't work... the line in green is the one that it considers as wrong. Does anybody can help me?

Could you post the rest of your code? I compiled this myself and it seemed to work, mind you it only read/printed the first line of the file.

Sorry I dont have java currently installed at my home.So cant check it right now. I am posting it now just compile it and check and still if some error is there will get back to you by monday after weekend