
{filelink=295}
/***** Code de MesExemples.com *******/
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
class ReadDoubleFromFile {
public static void main(String[] args) {
String strFilePath = "C://text.txt";
try
{
FileInputStream fin = new FileInputStream(strFilePath);
DataInputStream din = new DataInputStream(fin);
double d = din.readDouble();
System.out.println("Double : " + d);
din.close();
}
catch(FileNotFoundException fe)
{
System.out.println("FileNotFoundException : " + fe);
}
catch(IOException ioe)
{
System.out.println("IOException : " + ioe);
}
}
}