Hi everyone!
I want to read a text file with the scanner class like this:
But it says I haven't declared my file, how do I have to declare it then?
Thanks guys!
import greenfoot.*;
import java.io.File;
import java.util.Scanner;
public class pion extends Actor
{
int X, Y, timer=-1;
String reponse;
public void act()
{
MouseInfo mouse = Greenfoot.getMouseInfo();
File fichier = new File("reponse.txt");
Scanner scan = new Scanner(fichier);
reponse=scan.nextLine();
System.out.println(reponse);
