[Solved] How can I read a single word from a txt file and make it a variable in my code? [closed]

[ad_1]

Scanner in = new Scanner(new File("path_to_file.txt"));
String var = in.next();
var = var.trim();
in.close();

Not the most efficient way, but one of the simplest.

0

[ad_2]

solved How can I read a single word from a txt file and make it a variable in my code? [closed]