This is really fun and simple if you use Guava:
final File f = new File("your/file.txt");
final List<Float> listOfFloats =
Lists.transform(Files.readLines(f, Charset.defaultCharset()),
new Function<String, Float>(){
@Override
public Float apply(final String from){
return Float.valueOf(from);
}
});
And here's a similar version using Apache Commons / IO:
final File f = new File("your/file.txt");
final List<String> lines = FileUtils.readLines(f);
final List<Float> listOfFloats = new ArrayList<Float>(lines.size());
for(final String line : lines){
listOfFloats.add(Float.valueOf(line));
}